storing values of for loop in a long function
2 次查看(过去 30 天)
显示 更早的评论
So I have seen the tutorial on how to save every value of for loop in a matrix
eg:
for i=1:10
y(i)=i+rand
end
However, it doesn't seem to be too straight forward when the result of y is a consequence of a big function. I mean, if the variables a, b, c, d are dependent on i and u (a matrix) is dependent on a, b, c, d and finally y is dependent on u.
How do I solve this issue?
Hope I'm being clear enough. Cheers
1 个评论
Jan
2012-7-2
编辑:Jan
2012-7-2
Please post more details, most of all what you have tried so far and which problems occurred. Currently "it doesn't seem to be too straight forward" is not exactly enough to solve your problem.
Actually the solution could be very straight, but I assume, that I simply do not know the problem.
采纳的回答
Walter Roberson
2012-7-3
for i=1:10
a = some function of i
b = some function of i
c = some function of i
d = some function of i
u = some function of a, b, c, d
y(i) = some function of u
end
2 个评论
更多回答(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!