필터 지우기
필터 지우기

display info of pixel after for loop

조회 수: 2 (최근 30일)
Yoni Verhaegen
Yoni Verhaegen 2019년 6월 20일
편집: KALYAN ACHARJYA 2019년 6월 20일
Hi,
I am using a for loop over some weather data to indicate severity of a thunderstorm situation, see the code below.
I am wondering now, if I display the image with imagesc(), is there a way that by clicking on the pixel, the reason why this value is assigned will be displayed?
For example, if I click on a pixel with value 1, it would display a text box saying "because 10 < cape < 750 and shear < 20"
Thanks!
for i = 1:size(cape_fin,1)
for j = 1:size(cape_fin,2)
if cape_fin(i,j) > 10 && cape_fin(i,j) < 750 && shear_fin(i,j) < 20
hail_prob_level_fin(i,j) = 1;
elseif cape_fin(i,j) > 10 && cape_fin(i,j) < 750 && shear_fin(i,j) > 20 && shear_fin(i,j) < 40
hail_prob_level_fin(i,j) = 2;
elseif cape_fin(i,j) > 10 && cape_fin(i,j) < 750 && shear_fin(i,j) > 40
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 750 && cape_fin(i,j) < 1300 && shear_fin(i,j) > 20 && shear_fin(i,j) < 40 && tlr_600_800_fin(i,j) < 6.6 || tlr_500_700_fin(i,j) < 7.3
hail_prob_level_fin(i,j) = 2;
elseif cape_fin(i,j) > 750 && cape_fin(i,j) < 1300 && shear_fin(i,j) > 20 && shear_fin(i,j) < 40 && tlr_600_800_fin(i,j) > 6.6 || tlr_500_700_fin(i,j) > 7.3
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 750 && cape_fin(i,j) < 1300 && shear_fin(i,j) > 40 && tlr_600_800_fin(i,j) < 6.6 || tlr_500_700_fin(i,j) < 7.3
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 750 && cape_fin(i,j) < 1300 && shear_fin(i,j) > 40 && tlr_600_800_fin(i,j) > 6.6 || tlr_500_700_fin(i,j) > 7.3
hail_prob_level_fin(i,j) = 4;
elseif cape_fin(i,j) > 750 && cape_fin(i,j) < 1300 && shear_fin(i,j) < 20 && tlr_600_800_fin(i,j) > 7.3 || tlr_500_700_fin(i,j) > 7.9
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 750 && cape_fin(i,j) < 1300 && shear_fin(i,j) < 20 && tlr_600_800_fin(i,j) < 7.3 || tlr_500_700_fin(i,j) < 7.9
hail_prob_level_fin(i,j) = 2;
elseif cape_fin(i,j) > 1300 && cape_fin(i,j) < 2000 && shear_fin(i,j) > 40 && tlr_600_800_fin(i,j) > 6.6 || tlr_500_700_fin(i,j) > 7.3
hail_prob_level_fin(i,j) = 4;
elseif cape_fin(i,j) > 1300 && cape_fin(i,j) < 2000 && shear_fin(i,j) > 40 && tlr_600_800_fin(i,j) < 6.6 || tlr_500_700_fin(i,j) < 7.3
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 1300 && cape_fin(i,j) < 2000 && shear_fin(i,j) > 20 && shear_fin(i,j) < 40 && tlr_600_800_fin(i,j) < 7.3 || tlr_500_700_fin(i,j) < 7.9
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 1300 && cape_fin(i,j) < 2000 && shear_fin(i,j) > 20 && shear_fin(i,j) < 40 && tlr_600_800_fin(i,j) > 7.3 || tlr_500_700_fin(i,j) > 7.9
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 1300 && cape_fin(i,j) < 2000 && shear_fin(i,j) < 20
hail_prob_level_fin(i,j) = 3;
elseif cape_fin(i,j) > 2000 && shear_fin(i,j) > 40 && tlr_600_800_fin(i,j) > 6.6 || tlr_500_700_fin(i,j) > 7.3
hail_prob_level_fin(i,j) = 5;
elseif cape_fin(i,j) > 2000 && shear_fin(i,j) > 40 && tlr_600_800_fin(i,j) < 6.6 || tlr_500_700_fin(i,j) < 7.3
hail_prob_level_fin(i,j) = 4;
elseif cape_fin(i,j) > 2000 && shear_fin(i,j) > 20 && shear_fin(i,j) < 40 && tlr_600_800_fin(i,j) < 7.3 || tlr_500_700_fin(i,j) < 7.9
hail_prob_level_fin(i,j) = 4;
elseif cape_fin(i,j) > 2000 && shear_fin(i,j) > 20 && shear_fin(i,j) < 40 && tlr_600_800_fin(i,j) > 7.3 || tlr_500_700_fin(i,j) > 7.9
hail_prob_level_fin(i,j) = 4;
elseif cape_fin(i,j) > 2000 && shear_fin(i,j) < 20
hail_prob_level_fin(i,j) = 4;
else
hail_prob_level_fin(i,j) = 1;
end
end
end

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 6월 20일
편집: KALYAN ACHARJYA 2019년 6월 20일
improfile;
Read here
Is this are you looking for?

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by