Re: [問題]有關cfun

看板MATLAB作者 (Tremendo!)時間13年前 (2012/05/14 19:53), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
: the following error occurred converting from cfit to double : error using=>double : conversion to double from cfit is not possible : error in=>bbfit(i,:)=cfun 因為cfun不是數字 所以不能存到矩陣中 我想到的解決方法有2 1 把你fit的那行output的cfun另成5000個變數 每個變數自己存自己的cfun bb=rand(5000,30) ; bbfit=zeros(5000,30); for i=1:5000 a=1:30; b=bb(i,:); eval(['[cfun' num2str(i) ',gov,output]=fit(a'',b'',''poly5'')']); end 2 把cfun放到structure裡面 bbfit=zeros(5000,30); for i=1:2 a=1:30; b=bb(i,:); [cfun,gov,output]=fit(a',b','poly5'); Data(i).cfun=cfun; end 參考看看 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.103.220

05/15 09:29, , 1F
感謝大大提點...我來試試...謝謝~~~
05/15 09:29, 1F
文章代碼(AID): #1FiF9CCx (MATLAB)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
文章代碼(AID): #1FiF9CCx (MATLAB)