MATLAB now supports non-numeric matrix multiplication!

Fun
Follow


MATLAB now supports non-numeric matrix multiplication!

cui,xingxing on 19 Feb 2025 at 1:57 (Edited on 19 Feb 2025 at 2:04)
Latest activity Reply by cui,xingxing on 21 Feb 2025 at 1:09

Check out the result of "emoji matrix" multiplication below.
  • vector multiply vector:
a = ["😁","😁","😁"]
Warning: Function mtimes has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
Warning: Function mtimes has the same name as a MATLAB built-in. We suggest you rename the function to avoid a potential name conflict.
a = 1x3 string array
"😁" "😁" "😁"
b = ["😂";
"😂"
"😂"]
b = 3x1 string array
"😂" "😂" "😂"
c = a*b
c = "😁😂😁😂😁😂"
  • matrix multiply matrix:
matrix1 = [
"😀", "😃";
"😄", "😁"]
matrix1 = 2x2 string array
"😀" "😃" "😄" "😁"
matrix2 = [
"😆", "😅";
"😂", "🤣"]
matrix2 = 2x2 string array
"😆" "😅" "😂" "🤣"
resutl = matrix1*matrix2
resutl = 2x2 string array
"😀😆😃😂" "😀😅😃🤣" "😄😆😁😂" "😄😅😁🤣"
enjoy yourself!
Sign in to participate
Adam Danz
Adam Danz on 20 Feb 2025 at 19:53
😀
Here's some more fun
erase("👨‍🎓","🎓")
ans = "👨‍"
replace("👨‍👦","👦","👧")
ans = "👨‍👧"
How this works
Let's look at the double representation of the graduate emoji
double('👨‍🎓')
ans = 1×5
55357 56424 8205 55356 57235
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
In this case [55357 56424] is the person's face, [55356 57235] is the cap, and 8205 is the zero-width joiner (ZWJ). Let's look at each part separatly.
char([55357 56424])
ans = '👨'
char([55356 57235])
ans = '🎓'
join(["❤️", "🔥"])
ans = "❤️ 🔥"
You can join emojis using addition or character concatenation. Don't forget the ZWJ.
["❤️" + char(8205) + "🔥"]
ans = "❤️‍🔥"
Let's have more fun
["️❤️" + char(8205) + "🔥"]
ans = "️❤️‍🔥"
['🙂', char(8205), '↔️']
ans = '🙂‍↔️'
['❤️', char(8205), '🩹']
ans = '❤️‍🩹'
['🫱🏻', char(8205), '🫲🏿']
ans = '🫱🏻‍🫲🏿'
['🐦', char(8205), '🔥']
ans = '🐦‍🔥'
Here's a table of other emoji combinations. Who can create a polar bear from bear+snow?
Not all emojis are suported!
cui,xingxing
cui,xingxing on 21 Feb 2025 at 1:09
Thank you for your addition@Adam Danz
Adam Danz
Adam Danz on 20 Feb 2025 at 20:00 (Edited on 20 Feb 2025 at 20:00)
cui,xingxing
Algorithm Engineer- I received my B.E in Mechanical Engineering from Yangtze University, China in 2013, and M.Sc. in Mechanical Engineering from Guangxi University of Science and Technology, China in 2016. After graduation, I have been working in She...
11
Posts
245
Replies
5
Followers

Tags

No tags entered yet.

Go to top of page