How do I fill an editor box in app designer (numeric or text based on case) with outputs from a regular matlab code?

2 visualizaciones (últimos 30 días)
I have an output window that I am trying to have display calculated values from another MATLAB file. I am calling that file into the GUI but can not seem to get any values displayed. I am also trying simple displays by me typing in the code what I want to display but nothing is showing.
These are the editor boxes I am trying to fill with values. I have tried this:
methods (Access = public)
function updateCOEs(app)
app.OrbitEditField.Value = 'hi';
end
end
As well as messing with the callback functions but get nothing. Could anyone help me just figure out how to display something simple like the code above? I can figure it out from there..Thank you!

Respuestas (1)

Luca Ferro
Luca Ferro el 18 de Abr. de 2023
Editada: Luca Ferro el 18 de Abr. de 2023
The script has its own scope and the app has its own scope. The script cannot use variables and methods outside of his scope.
What you could do is create a callback from the app where you call the script. Something along the lines of:
function updateEditField_cb ()
updateCOEs;
end
also, make sure that the edit field you are trying to edit supports the data type you are trying to write, for example a numeric edit field cannot accept a string (in this case 'hi') as field. hence it will show nothing

Categorías

Más información sobre Environment and Settings 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