How to store the result of each iteration of a forloop into an array MATLAB

1 vue (au cours des 30 derniers jours)
How to store the result of each iteration of a forloop into an array MATLAB. I am imported data(i.e., K, L, T)matrix from simulink to workspace. I want to calculate the transfer functions in MATRIX form.
This program calculating Transfer functions.
But, when i am using this "v".
I am getting last element of the matrix.
Can you please help me, How to store all matrix elements in MATLAB.
clc
K;
L;
T;
one;
for i=1:4
for j=1:4
v=tf([K(i*j)],[T(i*j) one(i*j)], [L(i*j)])
end
end

Réponse acceptée

Mischa Kim
Mischa Kim le 14 Fév 2014
Modifié(e) : Mischa Kim le 14 Fév 2014
Chandra, use
v{i,j} = tf([K(i*j)],[T(i*j) one(i*j)], [L(i*j)])
  8 commentaires
CHANDRA SHEKHAR BESTA
CHANDRA SHEKHAR BESTA le 14 Fév 2014
Ya, Thank you Mischa Kim.
CHANDRA SHEKHAR BESTA
CHANDRA SHEKHAR BESTA le 14 Fév 2014
Sir, It's working but. In transfer function, I want the in each and ever element same coefficients
(i.e,
tf( [K(1*1)], [T(1*1) one(1*1)], [T(1*1)])) ....
...
tf( [K(4*4)], [T(4*4) one(4*4)], [T(4*4)]))
Can you please send me code for this.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by