Save plots in a for cycle
Ältere Kommentare anzeigen
Hey guys, I have this code that correlates two signals with a large amount of samples(30 million). I want to see the plot in the code(surf) for all the iterations, maybe, not all, but perhaps skipping one iteration. Meaning I see the plot in one iteration, the next I dont see, the following I see, and so on. How can I make this, so that the plots are saved in PNG perhaps,to a folder in my pc identified with different number so I can see which iteration it was.
I wanted to do this in a good matlab way, since there are a lot of plots.
Thanks in advance
reference_reshaped = reshape(Reference_signal, 1000, 4, []);
surveillance_reshaped = reshape(Surveillance_signal, 1000, 4, []);
counter=1;
sz = size(reference_reshaped);
for i = 1:sz(3)
r = reference_reshaped(:,1,i);
s = surveillance_reshaped(:,1,i);
[afmag3,delay3,doppler3] = ambgfun(r,s,Fs,[250000 250000]);
afmag3(afmag3>1 )= 1;
counter=counter+1
figure;
surf(delay3,doppler3,afmag3,'LineStyle','-.');
shading interp;
axis([-1e-5 1e-5 -2000 2000]);
grid on;
view([140,35]);
colorbar;
ylabel('Doppler (Hz)');
xlabel('Delay(s)');
title('Ambiguity Function Sref');
end
2 Kommentare
Abderrahim. B
am 6 Jul. 2022
Hi!
Some informations are needed to help :
- Share reference_signal and Surveillance_signal if possible.
- Clarify further your question.
Thanks
Miguel Albuquerque
am 6 Jul. 2022
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Printing and Saving finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!