How do I fill an editor box in app designer (numeric or text based on case) with outputs from a regular matlab code?
조회 수: 9 (최근 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!