[問題] fzero的問題已回收

看板MATLAB作者 (mai)時間15年前 (2008/10/15 14:23), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/4 (看更多)
>> N=3; X=[]; for i=0:N X=[X,fzero('tan(x)-((10/x)-1)^(0.5)',i*pi)] end Warning: Divide by zero. > In inlineeval at 13 In inline.subsref at 25 In fzero at 305 ??? Error using ==> fzero Function value at starting guess must be finite and real. 請問有辦法設定x的範圍嗎? 我是想在x=0~3*PI  算出tan(x)與((10/x)-1)^(0.5)的交點的x值 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.113.87.246

10/15 16:01, , 1F
可以試試看其他最佳化toolbox來用,可設定邊界
10/15 16:01, 1F
文章代碼(AID): #18zOni-I (MATLAB)
文章代碼(AID): #18zOni-I (MATLAB)