필터 지우기
필터 지우기

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 CenterFile Exchange에서 Structured 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