Fun
Follow


MATLAB now supports non-numeric matrix multiplication!

cui,xingxing on 19 Feb 2025 at 1:57 (Edited on 7 Mar 2025 at 0:56)
Latest activity Edit by cui,xingxing on 7 Mar 2025 at 0:56

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 = "๐Ÿ˜๐Ÿ˜‚๐Ÿ˜๐Ÿ˜‚๐Ÿ˜๐Ÿ˜‚"
d = b*a
d = 3x3 string array
"๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜" "๐Ÿ˜‚๐Ÿ˜"
  • matrix multiply matrix:
matrix1 = [
"๐Ÿ˜€", "๐Ÿ˜ƒ";
"๐Ÿ˜„", "๐Ÿ˜"]
matrix1 = 2x2 string array
"๐Ÿ˜€" "๐Ÿ˜ƒ" "๐Ÿ˜„" "๐Ÿ˜"
matrix2 = [
"๐Ÿ˜†", "๐Ÿ˜…";
"๐Ÿ˜‚", "๐Ÿคฃ"]
matrix2 = 2x2 string array
"๐Ÿ˜†" "๐Ÿ˜…" "๐Ÿ˜‚" "๐Ÿคฃ"
resutl = matrix1*matrix2
resutl = 2x2 string array
"๐Ÿ˜€๐Ÿ˜†๐Ÿ˜ƒ๐Ÿ˜‚" "๐Ÿ˜€๐Ÿ˜…๐Ÿ˜ƒ๐Ÿคฃ" "๐Ÿ˜„๐Ÿ˜†๐Ÿ˜๐Ÿ˜‚" "๐Ÿ˜„๐Ÿ˜…๐Ÿ˜๐Ÿคฃ"
enjoy yourself!
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)

Tags

No tags entered yet.