Filter löschen
Filter löschen

Troubleshooting a 'for' loop code - help!

1 Ansicht (letzte 30 Tage)
fiona rozario
fiona rozario am 11 Feb. 2017
Bearbeitet: Walter Roberson am 11 Feb. 2017
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Feb. 2017
You have
encrypt(i,j)=temp
but your i is always 1, so you never write outside of the first row.
  1 Kommentar
fiona rozario
fiona rozario am 11 Feb. 2017
Oops! Thanks a lot! Very foolish of me to have overlooked that...

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by