フィルターのクリア

Output regression tree as text

3 ビュー (過去 30 日間)
Stuart Pritchard
Stuart Pritchard 2021 年 12 月 6 日
コメント済み: Stuart Pritchard 2021 年 12 月 7 日
I'm currently creating a single regression tree using TreeDomain = fitrtree(Predictors,Predicted);
I need to save the output of view(TreeDomain) as text so I can use as a script in a non-Matlab environment. view(TreeDomain) puts the text on the screen, how can I store that output in a variable, or how can I interrogate the model to extract this information?

採用された回答

Walter Roberson
Walter Roberson 2021 年 12 月 6 日
You can use evalc() to get the results into a character vector.
  3 件のコメント
Walter Roberson
Walter Roberson 2021 年 12 月 6 日
T=evalc('view(TreeDomain)');
Stuart Pritchard
Stuart Pritchard 2021 年 12 月 7 日
Perfect, thanks

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

その他の回答 (1 件)

Chunru
Chunru 2021 年 12 月 6 日
view(TreeDomain) will not return result to a variable. You can use "diary" function to save the result to a file:
diaray tree_result.txt
view(TreeDomain)
diary off
% The the tree output is stored in the specified file
  1 件のコメント
Stuart Pritchard
Stuart Pritchard 2021 年 12 月 6 日
Thanks, that worked well. Shame it goes to file instead of a variable though.

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

カテゴリ

Help Center および File ExchangeStructured Data and XML Documents についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by