看板 MATLAB 關於我們 聯絡資訊
% myfun.m function Y = myfun(x) a=1;b=2;c=3; y1 = tan(a*x); y2 = (b+c) ./ (x.*(1-b*c./x.^2)); Y = y1-y2; end ------------------ command window: x0 = 5; fzero(@myfun,x0) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.195.56.148
cook200277:還是會出現function definition錯誤耶~~是版本問題嗎?? 11/11 19:06
Raymond0710:2010a OK 11/11 21:22
Raymond0710:上面那個要寫成m-file 11/11 21:23
cook200277:我全部複製貼上都還是一直出現function定義錯誤耶~~ 11/14 14:04
cook200277:function弄OK了,但fzero一直無法執行 11/14 14:45
cook200277:Undefined function or method 'isfinite' for input 11/14 14:50
cook200277:arguments of type 'sym'---錯誤訊息 11/14 14:52
Raymond0710:你的matlab可能沒有symbolic tool 11/14 19:33