필터 지우기
필터 지우기

App Designer Printing Code Results in GUI

조회 수: 15 (최근 30일)
Daniel Seligman
Daniel Seligman 2020년 8월 10일
답변: Sourabh Kondapaka 2020년 8월 13일
I am creating an app in in App Designer in which I run a program and need the results printed in the GUI and not just the Matlab Command Window. I am fairly new to Matlab and don't have much experience with programming at all. The results will be quite long and I do not know if that makes a difference. If anybody could help me, I would be greatly appreciative.
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2020년 8월 10일
Daniel - what can you tell us about the resutls? Are they suited to being displayed in a table or in a text field? Please provide some details.
Daniel Seligman
Daniel Seligman 2020년 8월 10일
The results will be best suited for a text field. There will be about 60 lines of text that will come from my program. It's all important and all needs to be available. Is there anything else that is important to know? Thank you.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sourabh Kondapaka
Sourabh Kondapaka 2020년 8월 13일
Hi,
You could use the “evalc()” function to capture the output of a matlab program or even a matlab command.
Then you could change the value of the Label in by accessing the “Text” property of the Label in App Designer.
I’m assuming you would want to run a program on a button click and then capture the output of that program and display it on a label.
Please make sure that the MATLAB program that you are trying to run is in the search path of MATLAB.
If you like to know how to add the a new directory to MATLAB search path, you can refer to the links here and here.
Here ‘tryOut.m’ is the MATLAB program that I’m trying to run.
% Button pushed function: Button
function ButtonPushed(app, event)
output = evalc('tryOut');
app.Label.Text = output;
end

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by