Borrar filtros
Borrar filtros

Send variables through functions in Matlab GUI

2 visualizaciones (últimos 30 días)
Jonasz
Jonasz el 13 de Sept. de 2013
What is the best way to send a variable ( a set of intensities) to second function in GUI

Respuestas (2)

Arthur
Arthur el 13 de Sept. de 2013
  2 comentarios
Jonasz
Jonasz el 14 de Sept. de 2013
Editada: Jonasz el 14 de Sept. de 2013
It's not exactly what I want. I have my own function which start running when I press button in Matlab GuI. In callback button this function is set and I want the output of this function - [this is a large table ( a mat file)] send to other callback function where I have also other function ( written by me) which use this table to other calculations. I tried to pass it via handles - and the result was bad.
Image Analyst
Image Analyst el 14 de Sept. de 2013
When you say "this function is set", I assume you mean "this function is called". So show us the line in your pushbutton callback where you call "my own function" so we can see how you called it -- what the input and output arguments were. MATLAB is pass by value so you should just be able to return your table - I'm assuming that means array. And then show us how you tried to send this output to the other callback function. If it wasn't via globals, or anything in the video, or anything in the FAQ link I showed you, then just how did you do it? Did you attach the output to handles? And how did you call the second callback from within the first callback? Was it something like this:
function button1_Callback(hObject, eventdata, handles)
handles.myLargeTable = myFunction(handles, otherInput1, otherInput2);
button2_Callback(hObject, eventdata, handles);
You must give us some code - it's unproductive to just guess at what you might or might not have.

Iniciar sesión para comentar.


Image Analyst
Image Analyst el 13 de Sept. de 2013
I'd say through the argument list, but there are other ways listed in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by