Find maximum in graphic

2 vues (au cours des 30 derniers jours)
Miguel Albuquerque
Miguel Albuquerque le 1 Juil 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

Réponse acceptée

Mathieu NOE
Mathieu NOE le 4 Juil 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]);

Plus de réponses (0)

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by