Save Regression Tree using Matlab commands

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by