Extracting data from a loop
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I run a 'FOR' loop with increment of 'mu'...within this I run another 'while' loop to get value of 'lamda' using this 'mu' value which continues to run until the system establish equilibrium...at a certain value of 'mu'...the system is not able to establish equilibrium...I have two problems...I want to know the last incremental value of 'mu' at which equilibrium is possible and the corresponding 'lamda' value??...Secondly I dont know what is the max. value of mu at which I can get equilibrium and sometimes it comes in between two incremental values of 'mu'...but as I am running a 'FOR' loop so it will not give me that value...IS there any way to find it??..Thanks in advance
0 commentaires
Réponses (1)
mohammed
le 2 Juin 2011
u can get the last value of mu by typing mu in new line without ";"
example
mu
to get max mu u have to store all value of mu in vector, then use max function
example
mymu=[100];% any number out of range
for epoch=1:400 mu = mu * x;%your formula
mu % to print mu value
mymu = [mymu;mu];
end
max(mymu)
0 commentaires
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!