How to print value in Textbox in app designer

25 ビュー (過去 30 日間)
Stephen john
Stephen john 2022 年 7 月 19 日
回答済み: Kevin Holly 2022 年 7 月 19 日
The dataset attached which is matlab file which includes Output name CombineOutput
i want to print Class 1 variable which is basically a cell name as StagPRFValue in pred 2.
I want to print unique values of Class 2 which DSPRFValue and DS Length in pred1
How can i do that
s = load('matlab.mat')
CombineOutput = s.CombineOutput
for z = 1:3
pred = sprintf('Cluster %1.0f Predicted PRI: %s\n',z,CombineOutput(z).Prediction);
app.TextArea.Value{z} = pred;
switch CombineOutput(z).Prediction
case "Class 1"
pred1 = sprintf('Class 2 Levels: %d\n Maximum Value of Class 2:%d\n Minimum Value of Class 2:%d\n ',CombineOutput(z).ValueStructure.Levels,CombineOutput(z).ValueStructure.DSmaximum,CombineOutput(z).ValueStructure.DSminimum);
app.TextArea_2.Value = pred1;
case "Class 2"
pred2 = sprintf('Class1 Levels: %d\n Maximum Value of Class1:%d\n Minimum Value of Class1:%d\n',CombineOutput(z).ValueStructure.StagLevels,CombineOutput(z).ValueStructure.StaggMinimumValue,CombineOutput(z).ValueStructure.StaggMaximumValue);
app.TextArea_3.Value = pred2;
end
end

回答 (1 件)

Kevin Holly
Kevin Holly 2022 年 7 月 19 日
Stephen,
Please see the app attached and make sure matlab.mat file you created is in your path before running app.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by