This is my code -
The code is not running through the second for loop i.e. for 'l'. As a result elements of only the first row of all columns are getting updated. Output is:
encrypt =
44 140 108
0 0 0
0 0 0
What did I miss in the code?

 채택된 답변

Walter Roberson
Walter Roberson 2017년 2월 11일

0 개 추천

You have
encrypt(i,j)=temp
but your i is always 1, so you never write outside of the first row.

댓글 수: 1

fiona rozario
fiona rozario 2017년 2월 11일
Oops! Thanks a lot! Very foolish of me to have overlooked that...

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2017년 2월 11일

편집:

2017년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by