Cody

Problem 45282. Cryptography with A Square Matrix : Decoding

Previous Problem: Cryptography with A Square Matrix : Encoding

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

100.0% Correct | 0.0% Incorrect
Last Solution submitted on Feb 09, 2020

Problem Comments

Problem Recent Solvers3

Suggested Problems

More from this Author59