pleasee please i need help with this code in app designer

2 ビュー (過去 30 日間)
jana
jana 2022 年 11 月 30 日
編集済み: DGM 2022 年 11 月 30 日
im working on appdesigner this is the code for a button to import an image to an axes(the place for the image to appear in) the interface is shown down left /the name of the axes is UIAxes (the place where i want my picture to be shown) but i keep getting this error and when the image imports ,its isshown in a different tab not in the wated place in my interface (UIAxes)what the solution please and heres the image

採用された回答

DGM
DGM 2022 年 11 月 30 日
編集済み: DGM 2022 年 11 月 30 日
The character 'a' isn't valid data for plot(). You might mean
plot(app.UIAxes,a)
... but passing an image to plot() isn't likely to do anything but create a bunch of nonsense.
That said, you're already displaying the image a by doing
imshow(a);
... so I don't see why the plot() call is even necessary. You could perhaps be more explicit with imshow():
imshow(a,'parent',app.UIAxes);
As an aside, I don't know why you're setting the 'filename' field to a. Why would a filename be image data? Maybe you meant
setappdata(0,'filename',filename)
or
setappdata(0,'filename',fullfilename)

その他の回答 (0 件)

カテゴリ

Find more on Develop Apps Using App Designer in Help Center and File Exchange

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by