Save Regression Tree using Matlab commands

3 visualizzazioni (ultimi 30 giorni)
Jerry Feng
Jerry Feng il 13 Lug 2015
Risposto: Ilya il 13 Lug 2015
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!

Risposte (1)

Ilya
Ilya il 13 Lug 2015
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,'')

Categorie

Scopri di più su Printing and Saving in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by