Save variable to a matrix after a for loop
Show older comments
Hey guys this is probably very easy, but Im having troubles doing it.
I have this code, that cross-correlates two signals, from 2 matrixes. I would like to save all the outputs of the function in 3 matrixes(afmag3,delay3,doppler3). Also the code, takes too long to run , I dont know if this can be better. Thank you
[n,m]=size(surv_matrix);
[n2,m2]=size(ref_matrix);
for i=1:m
for ii=1:m2
Reference_SignalCut=ref_matrix(:,ii);
Surveillance_SignalCut=surv_matrix(:,i);
[afmag3,delay3,doppler3] = ambgfun(Reference_SignalCut,Surveillance_SignalCut,fs,[1e6 1e6]);
afmag3 = afmag3*1; % Select plot gain *1
afmag3(afmag3>1 )= 1;
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!