Extracting data from a loop

1 次查看(过去 30 天)
taffi
taffi 2011-6-2
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

回答(1 个)

mohammed
mohammed 2011-6-2
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)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by