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

조회 수: 1 (최근 30일)
Jayashree Walimbe
Jayashree Walimbe 2019년 7월 15일
댓글: Guillaume 2019년 7월 16일
What is the result of CD(1:8:8*16)=ciphertext ? Not able to interpret this.
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 7월 15일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Guillaume
Guillaume 2019년 7월 15일
편집: Guillaume 2019년 7월 16일
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.
  댓글 수: 2
Walter Roberson
Walter Roberson 2019년 7월 15일
It is 16 elements, Guillaume, not 15.
Guillaume
Guillaume 2019년 7월 16일
@Walter. Indeed! I don't know what I was thinking. Fixed now.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by