use of eval in loop, Index exceeds matrix dimensions.

1 回表示 (過去 30 日間)
Michiel Adams
Michiel Adams 2012 年 6 月 6 日
Hi,
I have 250 decision trees in a dataset called c1 .. c250
I am trying to use the isbranch function in a loop.
This is the code:
for i = 1:250
STR = sprintf('isbranch(c%d)',i);
branches = eval(STR);
end;
I used eval before to use these trees, and no error was showing then. Now I keep getting the error:
Index exceeds matrix dimensions.
Any suggestions would be welcome.
Thanks,
Michiel
  4 件のコメント
per isakson
per isakson 2012 年 6 月 6 日
Are "c1 .. c250" objects of the class, classregtree?
per isakson
per isakson 2012 年 6 月 7 日
How does the full error message read?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by