Troubleshooting a 'for' loop code - help!
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
fiona rozario
le 11 Fév 2017
Modifié(e) : Walter Roberson
le 11 Fév 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?
0 commentaires
Réponse acceptée
Walter Roberson
le 11 Fév 2017
You have
encrypt(i,j)=temp
but your i is always 1, so you never write outside of the first row.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!