Display an image in a UIaxes Matlab app designer

77 ビュー (過去 30 日間)
Alessandro Minali
Alessandro Minali 2019 年 12 月 12 日
編集済み: Ankit 2019 年 12 月 16 日
I want to display the image in a UIaxes , but the error is:
Expected input number 2, PARAM, to match one of these values:
Colormap', 'DisplayRange', 'InitialMagnification', 'XData', 'YData',
'Parent', 'Border', 'Reduce'
The input, '2', did not match any of the valid values.
a = fix(num_int/2);
for i = 1 : num_int
RMSE_map2 = RMSE(:,:,i);
RMSE_map2(~im_kidneys(:,:,i)) = NaN;
figure,imagesc(RMSE_map2,[0 0.8]) % please refer to the histogram to choose the range
colormap jet
colorbar
saveas(gcf,[dir_name3,'RMSE_slice_',int2str(i),'.jpg'], 'jpeg');
end
imshow('RMSE_slice_',int2str(a),'jpeg','Parent', app.UIAxes);
How can i modify this code?
  1 件のコメント
Ankit
Ankit 2019 年 12 月 16 日
編集済み: Ankit 2019 年 12 月 16 日
Are you trying to show RMSE_slice_xxx.jpg ? (for e.g. int2str(a) = xxx)
You can try following command:
imshow(['RMSE_slice_',int2str(a),'.jpg'],'Parent', app.UIAxes);

サインインしてコメントする。

回答 (1 件)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi 2019 年 12 月 16 日
imshow expects arguments like DisplayRange’, ‘Colormap’ etc. In the code given the use of ‘int2str(a)’ does not match any of the expecting arguments.
To display an image on a “UIFigure” you can use the below code
I = imshow('Filename.jpg', 'Parent', app.UIAxes);
In order to know more about what arguments can be passed to imshow refer to the following link
Hope this Helps!

カテゴリ

Help Center および File ExchangeRed についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by