필터 지우기
필터 지우기

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
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
CHANDRA SHEKHAR BESTA
CHANDRA SHEKHAR BESTA 2014년 2월 14일
Sir, i am getting all elements. But, I am not getting all elements in proper dimension. can you please correct my for loop code to get correct transfer function matrix for the above program.
Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 14일
What < proper dimension > means?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by