Using axes in GUI

5 ビュー (過去 30 日間)
Chethan
Chethan 2013 年 4 月 12 日
My interest is to display image in axes, I've 2 GUI's input_window and fig5. In my former GUI I've used one axes to display image using uigetfile ,
axes(handles.axes1);
imshow(fname);
Now by pressing pushbutton in 1st GUI it switches to fig5 GUI, where I've used so many axes to display multiple images, also i want to display *fname *image in one axes and it should automatically get displayed in fig5 GUI. For this I've used same above codes in Fig5_OpeningFcn
axes(handles.axes1);
imshow(fname);
I'm getting error like Undefined function or variable 'fname'. please help me how to pass variables between GUI's

回答 (1 件)

Image Analyst
Image Analyst 2013 年 4 月 12 日
Just use one GUI and put all controls on that. It's annoying for the user to have multiple windows that can get overlapped, hidden, misaligned, etc., plus you have the difficulty as a programmer when you need to make variables in one gui seen in the other, separate gui. Why not just avoid all that and have a single GUI?
That said, if you want to ignore my advice, it can be done. See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F, which actually also holds for single-GUI apps where different functions need to share variables.

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by