...initial guess% es = (optional) stopping criterion (%)% maxit = (optional) maximum allowable iterations% output:% root = real root% if necessary, assign default valuesif nargin...
分類:電腦與網際網路 > 程式設計 2006年04月05日
... % es = (optional) stopping criterion (%) % maxit = (optional) maximum allowable iterations % output: % root = real root if func(xl)*func(xu)>0 %if ...
分類:電腦與網際網路 > 程式設計 2007年01月10日
你的函數寫法都錯了tanh(x.^2-9) 才對 Matlab 不認識 tanh*(x^2-9)請改成下面匿名函數寫法後執行>> f=@(x) tanh(x.^2-9);>> df=@(x) sech(x.^2-9).^2.*2*x;>> r=newtraph(f,df,3.02);>> rr = 3--------------舉例而言sin(x) 不可以寫成 sin.*xsin(x).^2 不可以寫成 sin.^2.*x 2006-04-27 12:37:26 補充...
分類:電腦與網際網路 > 程式設計 2006年04月29日
這是二分法的程式 原本你必須有4個輸入的參數 但是程式中這2行指令 if nargin<5, maxit=50; end %if maxit blank set to 50 if nargin<4, es=0.001; end %if es blank set to 0.001 已經設定 若是輸入參數小於5 maxit=50 若是輸入參數小於4 es=0.001 但是前3個...
分類:電腦與網際網路 > 程式設計 2007年04月22日