how to create a Fig for GUI?

28 visualizaciones (últimos 30 días)
Niki
Niki el 8 de Sept. de 2011
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?

Respuestas (3)

Paulo Silva
Paulo Silva el 8 de Sept. de 2011
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.

Jan
Jan el 8 de Sept. de 2011
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 comentarios
Niki
Niki el 8 de Sept. de 2011
In fact I have a function,
I want to make a GUI, then I import data based on that
and in one small windows shows different methods that can be used.
that is all what I want to do for now
Jan
Jan el 8 de Sept. de 2011
@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.

Iniciar sesión para comentar.


Niki
Niki el 8 de Sept. de 2011
I just have created this Figure
M = figure('units','pixels','position',[500 500 200 50], 'menubar','none','numbertitle','off','name','Mohammad', 'resize','on')
do you think I can use of "Set" to change the background or something else I should add to this ?
my mean , for example how can I make a bigger figure? can I re-size it , not manually
  4 comentarios
Niki
Niki el 8 de Sept. de 2011
I found
m = load('clown')
m2 = image(m.X)
colormap(m.map)
Walter Roberson
Walter Roberson el 8 de Sept. de 2011
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by