Matlab for loops output
Mostra commenti meno recenti
Dear all, I am trying to solve the following loops in MATLAB.
N=4;
d=0.0019;
fc=77e9;
c=3e8;
tdr1=5.33e-7;
Sig = zeros(10:4);
for i=1:N
for AzAng_1 = -90:20:90
Delay_Apos = d*sind(AzAng_1)*((N+1)/2-i)/(c);
Delay_Apos = tdr1 + Delay_Apos;
Steer_Vec = exp(-1i*2*pi*fc*Delay_Apos);
Sig(:,i) = Steer_Vec;
end
i=i+1;
end
Sig
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
At the output, I want to have a matrix of order [10:4] with each row containing the output of 'inner for loop' having a specific value of i. I.e, First column (i=1) should have 10 different values of the 'inner for loop'. After these 10 inner iterations, i value should be updated and now with i=2, inner for loop should be solved and now, the 10 values of 'inner for loop' should be arranged in the 2 column of 'Sig'.
I am trying to solve it, but I only get the last output i.e a (1:4) order signal instead of a (10:4) Signal I need.
I have been working on it, but am unable to get the output I want. Help would be appreciated
Regards
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!