How to restart the some portion of script for number of times ?
Afficher commentaires plus anciens
I want to restart my some portion of script for number of times. Script is basically input-math-disp type code... Is there any loop or function to do so ? Please help...thx HAVE A GOOD DAY...
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 22 Août 2016
1 vote
Use a for loop
4 commentaires
Kelvin Viroja
le 23 Août 2016
Walter Roberson
le 23 Août 2016
for K = 1 : 3
X = input( sprintf('X #%d', K));
Y = X.^2;
end
Kelvin Viroja
le 26 Août 2016
Ben
le 26 Août 2016
Alternately, type
help for
in the command line.
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!