How do I fill an editor box in app designer (numeric or text based on case) with outputs from a regular matlab code?
8 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
Luca Ferro
2023-4-18
编辑:Luca Ferro
2023-4-18
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!