Prev: check_active_images
Next: Press keyboard code
From: us on 20 Jul 2010 16:09 "Ashwin " <m_ashwin_81(a)yahoo.com> wrote in message <i24up4$1rk$1(a)fred.mathworks.com>... > Thanks. I tweaked the disp member function to accept a file handle and used that to write to file. most CSSMers would rather use steve's approach, though... % t = result of example from % help classregtree txt=strread(evalc('t'),'%s','delimiter','\n'); % <- CELLSTR... txt=txt(4:end); % <- take care of ML's display format... disp(char(txt)); %{ Decision tree for classification 1 if PL<2.45 then node 2 elseif PL>=2.45 then node 3 else setosa 2 class = setosa 3 if PW<1.75 then node 4 elseif PW>=1.75 then node 5 else versicolor 4 if PL<4.95 then node 6 elseif PL>=4.95 then node 7 else versicolor 5 class = virginica 6 if PW<1.65 then node 8 elseif PW>=1.65 then node 9 else versicolor 7 class = virginica 8 class = versicolor 9 class = virginica %} % now, use T -or- CHAR(T) to create your file... us
From: us on 20 Jul 2010 16:17
"us " <us(a)neurol.unizh.ch> wrote in message <i24vp0$7b8$1(a)fred.mathworks.com>... > "Ashwin " <m_ashwin_81(a)yahoo.com> wrote in message <i24up4$1rk$1(a)fred.mathworks.com>... > > Thanks. I tweaked the disp member function to accept a file handle and used that to write to file. > > most CSSMers would rather use steve's approach, though... > > % t = result of example from > % help classregtree > > txt=strread(evalc('t'),'%s','delimiter','\n'); % <- CELLSTR... > txt=txt(4:end); % <- take care of ML's display format... > disp(char(txt)); > %{ > Decision tree for classification > 1 if PL<2.45 then node 2 elseif PL>=2.45 then node 3 else setosa > 2 class = setosa > 3 if PW<1.75 then node 4 elseif PW>=1.75 then node 5 else versicolor > 4 if PL<4.95 then node 6 elseif PL>=4.95 then node 7 else versicolor > 5 class = virginica > 6 if PW<1.65 then node 8 elseif PW>=1.65 then node 9 else versicolor > 7 class = virginica > 8 class = versicolor > 9 class = virginica > %} > % now, use T -or- CHAR(T) to create your file... a stupid typo... % now, use TXT -or- CHAR(TXT) to create your file... sorry for confusion... us |