Find maximum in graphic

1 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by