Matlab coding and workspace
Show older comments
How do I update the value stored in variable in workspace in every iteration while an infinite FOR loop is running in my matlab script?
2 Comments
madhan ravi
on 13 Jun 2019
Why is the for loop infinite? Why not use a while loop nor a condition (break) statement to suffice the loop?
Nits
on 13 Jun 2019
Answers (1)
KSSV
on 13 Jun 2019
A = zeros(100,1) ; % initilaize
for i = 1:100
A(i) = rand ; % update the value in loop
end
5 Comments
Nits
on 13 Jun 2019
KSSV
on 13 Jun 2019
First inf would be a very huge number. Show us your code and tell what you want.
Nits
on 13 Jun 2019
Walter Roberson
on 13 Jun 2019
I do not understand what you mean by "flash" in this situation ?
Nits
on 13 Jun 2019
Categories
Find more on Performance and Memory in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!