看板 MATLAB 關於我們 聯絡資訊
Signal=[23.6360000000000 14.0574000000000 6.72888000000000 3.86307000000000 2.54284000000000 2.01951000000000 1.76490000000000 1.55241000000000 1.44080000000000 1.37599000000000 1.31569000000000 1.27775000000000 1.23654000000000 1.20946000000000 1.19213000000000]; echotime=[7.73700000000000 13.3570000000000 18.9770000000000 24.5970000000000 30.2170000000000 35.8370000000000 41.4570000000000 47.0770000000000 52.6970000000000 58.3170000000000 63.9370000000000 69.5570000000000 75.1770000000000 80.7970000000000 86.4170000000000]; F1=@(x,xdata) x(1)+x(2)*exp(-xdata/x(3)); x0=[1.2061 56.4124 8.5219]; % initial guess [x1,resnorm,~,exitflag,output]=lsqcurvefit(F1,x0,echotime,Signal); F2=@(x,xdata) x(1)+x(2)*exp(-xdata/x(3))+(1-x(4))*exp(-xdata/x(5)); x0=[1.2061 0.0315 0.1255 -55.4127 8.5219]; % initial guess [x2,resnorm,~,exitflag,output]=lsqcurvefit(F2,x0,echotime,Signal); x1 x2 plot(echotime,Signal,'ro',echotime,F1(x1,echotime),'-',echotime,F2(x2,echotime),'--') legend('data','fit 1','fit 2') -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.250.64.98 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1473761559.A.6B2.html
hanhan3431: 為什麼我照著跑 顯示cfit.subsagn ?發生了什麼事 09/13 20:27
ksr310135: 不知道呢! 09/13 22:21