フィルターのクリア

How can I display an image when GUI is opened from windows explorer with .fig file?

1 回表示 (過去 30 日間)
Gökay Tunç
Gökay Tunç 2015 年 7 月 6 日
回答済み: Walter Roberson 2015 年 7 月 6 日
I am trying to add a logo in GUI. Logo is displayed when GUI's .m file is run from editor but it doesn't appear when I open GUI from its .fig file. I used the following script. How can I solve this problem?
function untitled_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to untitled (see VARARGIN)
axes(handles.logo)
matlabImage = imread('...image.jpg');
image(matlabImage)
axis off
axis image
% Choose default command line output for untitled
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 7 月 6 日
You cannot start a GUI by running its .fig file. You must start the GUI by running its .m file.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by