我需要做的一件事就是计算这个
delta_x=@(xn) (f(xn)/df(xn));通过这个,我假装计算xn,一个我之前在f和df中赋值的变量,它们是匿名函数,并除以它的值,但在命令窗口中出现:
Error in delta_x=@(xn) (f(xn)/df(xn))我还写道:
delta_x=f/df;其中f和df都以xn为参数
但是Matlab说:
Undefined function 'mdivide' for input arguments of type 'function_handle'. 我需要上这个班,我该怎么做?
发布于 2018-10-09 10:35:45
我尝试使用以下代码重现相同的错误,但没有得到任何错误
xn = [3 2 3];
%inilize function handler
d1 = @(xn) (fun1(xn)/fun2(xn));
d2 = @(xn) (fun1(xn)./fun2(xn));
%call the function
d1(xn) % = 2.1111
d2(xn) % = 2 3 2
function xout = fun1(x)
xout = x+1;
end
function yout = fun2(y)
yout = y-1;
end我们能知道你的matlab版本吗?
https://stackoverflow.com/questions/52707951
复制相似问题