How to select the range of data based on threshold range of our own choice?

조회 수: 1 (최근 30일)
Dear MATLAB experts,
I want to use only the points corresponding to relatively high amplitudes? (e.g., try -10 to 0 dB or -20 to -10 dB or -30 to -20 on the normalized plots).
In attached imaging data output which veries from -45 to 0 dB.
I want to make 3 classes and plot data in with 3 classes and 3 colors.
.
I lookforward to receive your suggestions. I tried an approach but it gives logical output which is not suitable for my case.
Tahnk you!
  댓글 수: 2
Image Analyst
Image Analyst 2022년 9월 20일
You can adapt the colormap to have only 3 colors. Please attach your original image varible in a .mat file if you want anybody to try anything. What do you want to be the color if the value is outside your ranges? Why do your three ranges (-10 to 0 dB, or -20 to 10 dB, or -30 to -10) overlap? For example a -15 : which class should it be in the second or the third???
Amjad Iqbal
Amjad Iqbal 2022년 9월 20일
Sorry, for my mistake.
I corrected the ranges (-10 to 0 dB or -20 to -10 dB or -30 to -20) in three classes now, as high, medium and low respectively.
Also the .mat file is attached for reference.
load('output_classes.mat'); % data
imagesc(x_vect, y_vect,20*log10(abs(S_VH)/max(max(abs(S_VH)))),[-45 0]),...
axis('equal'),axis('tight'),title('Output'),colormap('jet'),...
colorbar,set(gca,'FontSize',14),grid;
Please have a look, Thank you!

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2022년 9월 20일
Try this:
load('output_classes.mat'); % data
intensity = 20*log10(abs(S_VH)/max(max(abs(S_VH))));
imagesc(x_vect, y_vect, intensity,[-45 0]);
axis('equal');
axis('tight');
title('Output');
cmap = [0,0,0;
1,0,0;
0,1,0;
0,0,1
]
cmap = 4×3
0 0 0 1 0 0 0 1 0 0 0 1
colormap(cmap);
colorbar;
caxis([-40, 0]);
set(gca,'FontSize',14)
grid;
  댓글 수: 1
Amjad Iqbal
Amjad Iqbal 2022년 9월 20일
Much appreciated dear @Image Analyst
It's very fast and much accurate method. Thank you for your kind input and providing solution

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by