Troubleshooting a 'for' loop code - help!

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?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Feb. de 2017
You have
encrypt(i,j)=temp
but your i is always 1, so you never write outside of the first row.

1 comentario

fiona rozario
fiona rozario el 11 de Feb. de 2017
Oops! Thanks a lot! Very foolish of me to have overlooked that...

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 11 de Feb. de 2017

Editada:

el 11 de Feb. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by