フィルターのクリア

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 Center および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by