App Designer Printing Code Results in GUI

19 ビュー (過去 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 Center および File ExchangeDevelop 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