Read a matrix between elements
Show older comments
Hey Guys, I need to read two variables, that have a large amount of samples(30 million values).
I need to select a thousand values from that two variables, correlate them and produce a plot. Then I want to do this again, with new thousand samples, produce a new plot, and so on, till the end of the 30 million values.
I have this code:
So in the first iteration I want Reference_signal_samples(1:1000) and Surveillance_signal_samples(1:1000), do the code
[afmag3,delay3,doppler3], see the plot after the for loop and save it. Next iteration I want Reference_signal_samples(4000:5000) and Surveillance_signal_samples(4000:5000), do the code
[afmag3,delay3,doppler3], see the plot after the for loop and save it. Between iteration I want a step of 3000 samples.
How can i do this in my code, I ve been trying but I cant achieve it
pulse_size = 1000;
%nRef = numel(Reference_signal)/Fs;
%nSurv = numel(Surveillance_signal)/Fs;
nRef = numel(Reference_signal)/pulse_size;
nSurv = numel(Surveillance_signal)/pulse_size;
for k = 1:nRef
Reference_signal_samples =Reference_signal((k-1)*pulse_size+(1:pulse_size));
for kk =1:nSurv
Surveillance_signal_samples=Surveillance_signal((kk-1)*pulse_size+(1:pulse_size));
[afmag3,delay3,doppler3] = ambgfun(Reference_signal_samples,Surveillance_signal_samples,Fs,[250000 250000]);
afmag3(afmag3>1 )= 1;
end
end
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');
5 Comments
dpb
on 5 Jul 2022
30E6/1E3 ==> 30,000
What do you propose to do with 30K plots when you're done?
Miguel Albuquerque
on 5 Jul 2022
dpb
on 5 Jul 2022
I suspect you'll be exhausted long before you can even look at them all -- and the chance of seeing anything unique on one out of 30,000 is remote at best.
dpb
on 5 Jul 2022
OK, I missed the 3000 step interval -- that's a big improvement although 1,000 is still stretching the limits of human endurance and likelihood of really catching anything...
Miguel Albuquerque
on 5 Jul 2022
Accepted Answer
More Answers (1)
Sulaymon Eshkabilov
on 5 Jul 2022
One of the possible solutions can be using cell array to define the indices, something like this way:
INDEX = {1:1000, 4000:5000, ...}
for ii = 1:10
for jj = INDEX(ii)
...
end
end
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!