help debugging my script?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Christopher Maraj
le 13 Mar 2018
Modifié(e) : per isakson
le 18 Mar 2018
This script is meant to solve a set of differential equations and return an output consisting of the quantities [T,X,Y,Z,U,V,W] in the form of a vector. When i run the code nothing appears, only the name of my m-file in the command window. Could someone help me find where in my code I've made a mistake?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171206/image.png)
3 commentaires
Réponse acceptée
Stephen23
le 13 Mar 2018
Modifié(e) : Stephen23
le 13 Mar 2018
You wrote a while condition that will never be true. Have a look at this line:
while n <= n-2
For what values of n can this be true? Can you think of any real value of n where it is less than or equal to itself minus two? Try some real number examples, if you are not sure what is going on, e.g.:
n = 5
5 <= 5-2
5 <= 3
Is this ever going to be true?
0 commentaires
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!