How to save values of loops ?
1 次查看(过去 30 天)
显示 更早的评论
I made the following for loop and now want to save the different values I get on my command window in one vector: My Problem is that the following code doesn't work.
be=zeros(16,1);
for s=1:2:16
bety1=((z3(0+s:1+s,1:20)*z3(0+s:1+s,1:20)')^-1)*(z3(0+s:1+s,1:20)*y3(1:20));
be(s)=bety1
end
Can somebody help me ? Perhaps you need the info that at every bety1 I get a vector with 2 rows so in the end I should have a vektor with 16 rows.
0 个评论
采纳的回答
Azzi Abdelmalek
2016-1-4
be=zeros(16,1);
for s=1:2:16
bety1=((z3(0+s:1+s,1:20)*z3(0+s:1+s,1:20)')^-1)*(z3(0+s:1+s,1:20)*y3(1:20));
be(s:s+1)=bety1
end
更多回答(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!