Save Regression Tree using Matlab commands

3 ビュー (過去 30 日間)
Jerry Feng
Jerry Feng 2015 年 7 月 13 日
回答済み: Ilya 2015 年 7 月 13 日
Hi,
I generated a regression tree using RegressionTree.fit() command and I was able to view/save the tree using GUI as a result of command view(treename,'mode','graph'). However, I was not able to complete the saveas() procedure using Matlab commands, as I found no way to access the figure generated by the view() command.
I browsed some previous post including:
which suggests that I can assign a handle to the figure, for example :
h = view(treename,'mode','graph')
saveas(h,'filename','format')
However, when I attempt to do so with my Matlab R2013a, the command I mentioned above generated an error message:
>> h = view(treename,'view','graph')
Error using RegressionTree/view
Too many output arguments.
Can someone please offer some instructions on this?
Thanks in advance!

回答 (1 件)

Ilya
Ilya 2015 年 7 月 13 日
You can choose SaveAs from the figure pop-up menu when you click on File in the upper left corner.
If you can't find SaveAs for some reason, try this:
prunelevel = 0;
h = treename.Impl.viewGraph([],treename.NodeMean,treename.PredictorNames,prunelevel,'')

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by