matlab - What is the meaning of the addition at the end of this array declaration? -


I have been assigned the task of implementing an algorithm that was supplied as Matlab in our C ++ ( Which is none of us) app

The declared array is:

  encrypted = [18 10 20 13 6 25 21 13 17; 2 26 4 29 22 9 5 29 1; 19 11 21 12 7 24 20 12 16; % ... many rows of this kind ... 13 21 11 18 25 6 10 18 14] +1;  

What is the meaning of +1 at the end of the array announcement?

just add 1 to each entry:

  & gt; & Gt; [1 2 3; 4 5 6] ans = 1 2 3 4 5 6 & gt; & Gt; [1 2 3; 4 5 6] + 1 ans = 2 3 4 5 6 7 If you have MATLAB, you can understand that just by trying, if you do not, then I hope That you have this code very clear what the code is doing and write a good test suite, because you will not be able to compare the output of your new code to MATLAB one. 


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -