[問題]Curve fitting 輸出誤差

看板MATLAB作者 (漢堡)時間10年前 (2015/04/13 15:41), 10年前編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
想要請教一下 我在fit出斜直線後,想要輸出最後的誤差值 請問要怎麼輸出呢 Code如下: function [estimates, model] = fit_Line(x,y) start_point = 1; model = @linfun; estimates = fminsearch(model, start_point); function [sse, FittedCurve] = linfun(params) m = params(1); fit_Line = m*x; FittedCurve = fit_Line; ErrorVector = (FittedCurve - y); sse = sum(ErrorVector.^2); end end 目前只知道從fminsearch下手 找出最小的sse並將它輸出,但不知道實際上要怎麼操作 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.115.31.38 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1428910864.A.1FF.html ※ 編輯: chiangburger (140.115.31.38), 04/13/2015 15:44:13 ※ 編輯: chiangburger (140.115.31.38), 04/13/2015 16:05:22

04/15 15:07, , 1F
試著改用least square做?
04/15 15:07, 1F
文章代碼(AID): #1LAtCG7_ (MATLAB)
文章代碼(AID): #1LAtCG7_ (MATLAB)