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

8 Ansichten (letzte 30 Tage)
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!

Antworten (1)

Luca Ferro
Luca Ferro am 18 Apr. 2023
Bearbeitet: Luca Ferro am 18 Apr. 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

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by