Find maximum in graphic

6 visualizzazioni (ultimi 30 giorni)
Miguel Albuquerque
Miguel Albuquerque il 1 Lug 2022
Risposto: Mathieu NOE il 4 Lug 2022
Hey guys thanks in advance;
I have this code that represents a signal in time domain:
figure;
maxcolorbar=max(max(20*log10(abs(range_compressed_matrix))));
imagesc(1:400,time_compression_cut*c,abs(range_compressed_matrix));
colorbar;
colormap(jet);
%caxis([maxcolorbar-20 maxcolorbar]);
title('Range Compressed Data');
xlabel('Waypoints (m)');
ylabel('Range (m)');
xlim([0 400]);
And I get this figure:
I want to know the mamixum os this figure, I can see its in the red lines, however I dont know which is higher and for what range and waypoint that value is.
Thanks a lot

Risposta accettata

Mathieu NOE
Mathieu NOE il 4 Lug 2022
hello
following this example :
A = [1 2 3; 4 5 6]
[M,ind] = max(A,[],'all','linear') % max value of matrix
[row,col] = ind2sub(size(A),ind) ; % Convert linear indices to subscripts
applied to your code : the result appears in x_max and y_max
still I wonder why you compute the max of the log of the data but you display them in linear range
figure;
A = 20*log10(abs(range_compressed_matrix));
[maxcolorbar,ind] = max(A,[],'all','linear'); % max value of matrix
[row,col] = ind2sub(size(A),ind); ; % Convert linear indices to subscripts
xx = 1:400;
yy = time_compression_cut*c;
x_max = xx(row);
y_max = yy(col);
imagesc(xx,yy,abs(range_compressed_matrix));
colorbar;
colormap(jet);
%caxis([maxcolorbar-20 maxcolorbar]);
title('Range Compressed Data');
xlabel('Waypoints (m)');
ylabel('Range (m)');
xlim([0 400]);

Più risposte (0)

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by