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!