Now decode a double vector to a (hopefully!) meaningful text.
Inputs are encoded vector and key matrix.
encodedVector = [1665 1624 1541 1549 1495 1501 486 510 534 1503 1552 1595 1192 747 836]
key = magic(3);
inverse of key
inverseKey = [0.147222222222222 -0.144444444444444 0.0638888888888889
-0.0611111111111111 0.0222222222222222 0.105555555555556
-0.0194444444444445 0.188888888888889 -0.102777777777778];
Reshape encodedVector so it has the same number of rows with key
reshapedVector = [1665 1549 486 1503 1192;
1624 1495 510 1552 747;
1541 1501 534 1595 836];
Multiply inverseKey and reshapedVector, round it and reshape it;
messageVector = [109 97 116 108 97 98 32 38 32 99 111 100 121 32 32];
char equivalent of message vector is 'matlab & cody'
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers11
Suggested Problems
-
Sort a list of complex numbers based on far they are from the origin.
5793 Solvers
-
Find state names that end with the letter A
1197 Solvers
-
3037 Solvers
-
128 Solvers
-
Return the first and last characters of a character array
11795 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Your last two test cases do not actually test anything --- there's no assert() in these.
There are no answers defined by the author to test the last 2 cases.
@Duyman the missing correct answers are, respectively, 'backorder is an accumulation of customer orders that a manufacturer has promised for delviery at some future date.' and 'abc'.
(And yes, it really says 'delviery'; the original author probably had a typo in there he didn't catch.)