3 questions about guide

조회 수: 1 (최근 30일)
Cineva Slobozia
Cineva Slobozia 2011년 5월 25일
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
Arturo Moncada-Torres 2011년 5월 25일
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
Arturo Moncada-Torres 2011년 5월 25일
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