Matlab fzero()函数使用问题,新手求教 5
>>k=0.6;>>r=fzero('cos(x)-k',[12]);Errorusingfzero(line233)FZEROcannotcontinuebecause...
>> k=0.6;
>> r=fzero('cos(x)-k',[1 2]);
Error using fzero (line 233)
FZERO cannot continue because user supplied expression
==> cos(x)-k failed with the error below.
Error in inline expression ==> cos(x)-k
Undefined function or variable 'k'.
要怎么才能把k=0.6 带进cos(x)-k里面啊 subs还有double都试过了= = 展开
>> r=fzero('cos(x)-k',[1 2]);
Error using fzero (line 233)
FZERO cannot continue because user supplied expression
==> cos(x)-k failed with the error below.
Error in inline expression ==> cos(x)-k
Undefined function or variable 'k'.
要怎么才能把k=0.6 带进cos(x)-k里面啊 subs还有double都试过了= = 展开
2个回答
展开全部
k=0.6;
equ = cos(x)-k;
r=fzero(eq,[1 2]);
equ = cos(x)-k;
r=fzero(eq,[1 2]);
追问
k=0.6;
equ = cos(x)-k;
r=fzero(equ,[1 2]);
Error using fzero (line 169)
If FUN is a MATLAB object, it must have an feval method.
还是不行= =
追答
syms x
k=0.6;
equ = cos(x)-k;
r=fzero(eq,[1 2]);
加上第一句试试
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询