Extracting data from a loop
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
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)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!