How to store the result of each iteration of a forloop into MATLAB
2 次查看(过去 30 天)
显示 更早的评论
How to store the result of each iteration of a forloop into MATLAB.
This program calculating Transfer functions.
But, when i am using this "v".
I am getting last element only.
Can you please help me, How to store every iteration result in MATLAB.
This is the program. Thank you.
clc
K=[-0.098 -0.036 -0.014 -0.017;
-0.043 -0.092 -0.011 -0.012;
-0.012 -0.016 -0.102 -0.033;
-0.013 -0.015 -0.029 -0.108] ;
L=[17 27 32 30;
25 16 33 34;
31 34 16 26;
32 31 25 18];
T=[122 149 158 155;
147 130 156 157;
153 151 118 146;
156 159 144 128];
one=[1 1 1 1;
1 1 1 1;
1 1 1 1;
1 1 1 1];
for i=1:4
for j=1:4
v=tf([K(i*j)],[T(i*j) one(i*j)], [L(i*j)]);
end
end
采纳的回答
Azzi Abdelmalek
2014-2-14
编辑:Azzi Abdelmalek
2014-2-14
for i=1:4
for j=1:4
v{i,j}=tf([K(i*j)],[T(i*j) one(i*j)], [L(i*j)]);
end
end
%to get the transfer function for i=3 and j=2 for example
v{3,2}
4 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!