how to create a Fig for GUI?
27 次查看(过去 30 天)
显示 更早的评论
In fact I want to create a Fig for GUI and then start to make a GUI should I do that ? or there is any other way?
0 个评论
回答(3 个)
Paulo Silva
2011-9-8
Just type and execute:
guide
and have fun with it, don't forget to read the documentation
doc guide
The other way is to do it all on one function with subfunctions and lots of code, start with guide and when you feel comfortable using it you can do all with code, no .fig file required.
0 个评论
Jan
2011-9-8
Beside using GUIDE, you can create a GUI manually also. Some examples can be found in the toolboxes, e.g. read the sources of MSGBOX, LISTDLG and HELPDLG. A minimal example:
DlgH = figure;
ButtonH = uicontrol('Sytle', 'PushButton', 'Position', [10, 10, 100, 22], ...
'String', 'Button', 'Callback', 'disp(clock)');
[EDITED]: Please use "Style" instead of the typo "Sytle"!
You will get a more specific answer, if you explain your demands with any details.
3 个评论
Jan
2011-9-8
@Mohammad: Well, this is called a typo. Read the documentation of UICONTROL or inspect the list of its properties by "set uicontrol" to find out, that it should be "Style" instead of "Sytle". I expect a certain level of cooperation.
Niki
2011-9-8
4 个评论
Walter Roberson
2011-9-8
I would recommend instead using
m = load('clown');
m2 = ind2rgb(m.X, m.map);
image(m2);
Otherwise you "use up" your one and only figure colormap on a frill. Keep in mind: you can only have one colormap per figure.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!