trying to right code to generate matrix for three different frequency

1 次查看(过去 30 天)
Hello I have 3 frequencies w1 = 100 , w2 = 200 and w3 = 400
and I have state space model matrix
Ai = [0 1;-wi 0]
Bi = [0 wi]
ci = [1 0]
I want to generate these matrix for each frequencies i mentioned above and pack them in 1 final matrix respectively A, B and C
how should i do this ?
i have tried but its not working
w = [100 200 300]
for i = 1:3
A(i)=[0 1; w(i) 0]
B(i)=[0 w(i)]
end
any other suggestion or ways ?

采纳的回答

John Doe
John Doe 2013-5-6
编辑:John Doe 2013-5-6
w = [100 200 400];
A = zeros(2,2,3);
B = zeros(1,2,3);
C = zeros(1,2,3);
for i = 1:3
A(:,:,i) = [0 1; -w(i) 0];
B(:,:,i) = [0 w(i)];
C(:,:,i) = [1 0];
end
Hope this was what you're looking for.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by