What will be the output of of CD(1:8:8*16)=ciphertext

1 view (last 30 days)
What is the result of CD(1:8:8*16)=ciphertext ? Not able to interpret this.
  1 Comment
Walter Roberson
Walter Roberson on 15 Jul 2019
Imagine that CD is an array that is 8 x 16. Then that operation would be the same as storing values to the entire first row.

Sign in to comment.

Accepted Answer

Guillaume
Guillaume on 15 Jul 2019
Edited: Guillaume on 16 Jul 2019
It simply replaces elements 1,9,17, 25, ..., 121 of CD by the elements of ciphertext. Since that's 16 elements of CD that are replaced, if ciphertext does not have exactly 16 elements, the line is an error.
If CD is an 8x16 matrix, then as Walter commented, this replace the first row of CD. And in that case CD(1, :) = ciphertext would have been clearer.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!