Run m files by using GUI
Mostrar comentarios más antiguos
I need to run m file from the push button by using GUI and enter some variables before the run.How can I apply these by GUI? There is a loop in the m file. Is that a problem for the GUI application? I will be appreciated with your answers. If there is a simple example, I will be so satisfied.
With best regards.
Respuesta aceptada
Más respuestas (1)
Jan
el 31 de Jul. de 2011
You describe the one and only use of a GUI. Any GUI is used to define values and start a program, otherwise it is not a GUI, but a picture or a message box.
[EDITED] This is my small example:
A trivial example - save this as an M-file:
function myFirstGUI
figure;
ValueH = uicontrol('Style', 'edit', 'String', '0', ...
'Position', [10, 100, 100, 24]);
StartH = uicontrol('Style', 'PushButton', 'String', 'Start', ...
'Position', [10, 50, 100, 24], ...
'Callback', {@myFunction, ValueH});
function myFunction(ButtonH, EventData, ValueH)
S = get(ValueH, 'String');
Data = sscanf(S, '%g', 1);
plot(1:10, rand(1, 10) * Data);
[EDITED] End of my small example - @Dogus: Can you see it?
5 comentarios
Dogus Unlu
el 1 de Ag. de 2011
Dogus Unlu
el 3 de Ag. de 2011
nurliana aqilah
el 12 de Jun. de 2012
can anyone help me??i'm still cannot run mfile in gui..please..i don't understand how to use the command. i try to use open('filename') but it just open it not run it automatically
deniel munthe
el 12 de Jun. de 2012
i thing if you just want to run mfile in gui, you just call the function.m; it's will automaticly run your mfile
Fa'
el 19 de Jul. de 2012
Hi all!! I have to run mfile in gui too. I don't understand where I have to call the function, probably in the callback of the button related?
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!