Assign loop values into each rows

5 ビュー (過去 30 日間)
Yuling CAO
Yuling CAO 2016 年 9 月 19 日
編集済み: Andrei Bobrov 2016 年 9 月 19 日
Hi, I built a loop and want to assign each H12 and H34 result when i=1:600 into each rows? Can someone give me a code?
tsteps = 600; % timesteps
for i = 1:tsteps
% calculate autospectra
sp11 = conj(p1(i,:)).*p1(i,:);
sp33 = conj(p3(i,:)).*p3(i,:);
% calculate cross spectrum.
sp12 = conj(p1(i,:)).*p2(i,:);
sp34 = conj(p3(i,:)).*p4(i,:);
% calculate transfer function
H12 = sp11(i)./sp12(i);
H34 = sp33(i)./sp34(i);
end

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2016 年 9 月 19 日
sp11 = conj(p1).*p1;
sp33 = conj(p3).*p3;
sp12 = conj(p1).*p2;
sp34 = conj().*p4;
H12 = sp11./sp12;
H34 = sp33./sp34;

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by