How to call matlab built-in common functions, such as open, save as, in GUI?

2 vues (au cours des 30 derniers jours)
John
John le 21 Jan 2015
Commenté : Stephen23 le 9 Avr 2015
I'm new to GUI. I had this:
f = uimenu(h0,'Label','File');
uimenu(f,'Label','Open P-file','Callback','open');
uimenu(f,'Label','Save','Callback','save');
uimenu(f,'Label','Quit','Callback','exit',...
'Separator','on','Accelerator','Q');
The 'open' doesn't popup the path-file selection window; However the 'exit' works too good. It not only closes the figure, but also closes the entire matlab.
How to call matlab common functions like: open, save, save as, print, etc...
and not to 'exit' the entire matlab?
Thanks.

Réponses (1)

Zoltán Csáti
Zoltán Csáti le 22 Jan 2015
If you want to close the figure, do not click on Exit, but on Close. If you want to save something inside the GUI, use uisave, if you want to print the figure, use printdlg and if you want to open files interactively, choose uiopen.
  3 commentaires
Zoltán Csáti
Zoltán Csáti le 8 Avr 2015
Click on the links.
Stephen23
Stephen23 le 9 Avr 2015
@Jian: the "list" is the MATLAB documentation itself. Learn to browse the Contents on the left-hand side of the page, and discover that the documentation is arranged by categories... it really is useful to get to know your way around it!
For example, here is the list of user-interface dialog boxes and related functions.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by