how i can display confusionchart in app.UIAxes

9 ビュー (過去 30 日間)
Januwa
Januwa 2024 年 3 月 28 日
コメント済み: Voss 2024 年 3 月 28 日 22:13
Mdl = fitcknn(ciri_uji, target_uji, 'NumNeighbors', 2, 'Standardize', 1);
Y = target_uji;
predictedLabels = resubPredict(Mdl);
% Create confusion matrix
figure;
confusionchart(Y, predictedLabels);

回答 (1 件)

Voss
Voss 2024 年 3 月 28 日 18:32
編集済み: Voss 2024 年 3 月 28 日 18:34
According to the confusionchart documentation, you can specify the parent that the confusion chart will be created in, by specifying the appropriate parent container as the first argument in your call to confusionchart.
For instance, to put it directly in your app's uifigure, you can say:
confusionchart(app.UIFigure, Y, predictedLabels)
assuming the app's uifigure is called app.UIFigure. You could also put it in a panel or tab, etc., inside that uifigure.
  2 件のコメント
Januwa
Januwa 2024 年 3 月 28 日 21:43
What I mean is how can the confusionchart be displayed in app.uiaxes, instead of displaying it as a figure
Voss
Voss 2024 年 3 月 28 日 22:13
Sorry, I should have been more clear. You cannot make a confusion chart inside a uiaxes.
The documentation I linked to states that a confusion chart's parent is "a Figure, Panel, Tab, TiledChartLayout, or GridLayout object". Note that axes/uiaxes is not listed as a possibility.
So: you can put a confusion chart in your app (which I think is what you want), but not in a uiaxes (which is what you asked about).
Try this and see what happens:
confusionchart(app.UIFigure, Y, predictedLabels)

サインインしてコメントする。

カテゴリ

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