3 questions about guide
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hy and i'm glad i joined this community with so many experts - im not one of them :(. hope someone can help me. i do have some problems with guide and my gui. # 1st. i have to make a big project, with many different figures.its about a digital signals platform. i've made my template with my most important content, that doesn't change in the rest of the figures( menues, toolbars, and some static text and buttons). the first problem is how to code the menu items so when i open, lets say lab1/something, the current window close and open the something.fig from folder lab1. i used closereq; openfig('C:\snumerice\lab1\esantionare.fig'); but if i use this combination the new window opened doesn't initialize OpeningFcn callback and its preatty useless. what should i use? # 2nd. i have a static text that initialise at OpeningFcn with a string from an external file. the problem is that the file is txt and its pretty ugly with no formating at all. i want to initialise a .rtf or BETTER a word document with all its formating. is there any combination so i can modify String of a static text with content of a word doc? and# 3rd.i have read so much help files, but i still don't know how to make some global variables, to be used in the .m file. where can i define them so they could be used in my .m file from my gui, ex in a callback from one of my buttons and the same variable in another callback from other button.
Thx and i really hope someone cand help me with my questions.
2 commentaires
Arturo Moncada-Torres
le 25 Mai 2011
As a tip, try asking different questions in different posts please ;-) !
Réponse acceptée
Arturo Moncada-Torres
le 25 Mai 2011
Regarding your Question #3, you can use the handles structure. There, you can store variables that have a scope for all the callbacks. For example:
% Callback from element 1
% Choose default output
handles.output = hObject;
% ...
handles.myVariable = 1;
% ...
% Update handles structure
guidata(hObject, handles);
% Callback from element 2
% Choose default output
handles.output = hObject;
% ...
handles.myVariableCopy = handles.myVariable;
% ...
% Update handles structure
guidata(hObject, handles);
It is pretty easy actually. Hope it helps ;-) !
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!