Array of ClassificationTree objects
Show older comments
I am very new to MATLAB. I was trying to train some ClassificationTree's and the assign them in array with the following snippet
for k = 1:rows
tree=ClassificationTree.fit(data(1:k, 1:cols),labels(1:k));
ensemble(k)=tree;
end
however when I run this I get following error
??? Error using ==> DisallowVectorOps>DisallowVectorOps.subsasgn at 28
You cannot assign to an object of class double using () indexing.
Error in ==> dwm02 at 7
ensemble(k)=tree;
is there any way of doing this? MATLAB help on object arrays is a bit confusing..
1 Comment
Walter Roberson
on 6 Jun 2012
How did you initialize "ensemble" ?
Accepted Answer
More Answers (0)
Categories
Find more on Classification Ensembles in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!