3 questions about guide

1 次查看(过去 30 天)
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 个评论
Arturo Moncada-Torres
As a tip, try asking different questions in different posts please ;-) !
Cineva Slobozia
Cineva Slobozia 2011-5-25
next time i'll do. thx
after i'll understand how can i resolve my problems.

请先登录,再进行评论。

采纳的回答

Arturo Moncada-Torres
Regarding your Question #2, I suggest you take a look at the following file from the File Exchange.
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 个评论
Cineva Slobozia
Cineva Slobozia 2011-5-25
for 3rd question, the one that is the least important, i appreciate youre answer and it's good. i need answers for the others questions, though.
Matt Fig
Matt Fig 2011-5-27
I answered your other question, but you deleted it...

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by