Creating a loop and loop variable
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Laura T
le 7 Déc 2021
Modifié(e) : Yusuf Suer Erdem
le 7 Déc 2021
Hi guys,
How would I write a for loop in which the loop variable runs from 0 to pi/2 in steps of 0.01?
Am i right in saying:
for
A = 0:0.01:pi/2
end
Is this correct?
Réponse acceptée
Yusuf Suer Erdem
le 7 Déc 2021
Modifié(e) : Yusuf Suer Erdem
le 7 Déc 2021
for a=0:a+0.01:pi/2
disp(a)
end
4 commentaires
Yusuf Suer Erdem
le 7 Déc 2021
maybe used i as a character. i changed it with a. it should be okey now.
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!