What does the following error mean? Undefined function 'diffjac' for input arguments of type 'function_handle'. Error in Heq_Nwt (line 23) df = diffjac(x1,f,f0)
3 次查看(过去 30 天)
显示 更早的评论
My code is below. Not sure why I cannot use diffjac function. I also get an error for input arguments of type 'double' if I change my diffjac inputs to (x1,f,f0).
function [ x, ex] = Heq_Nwt( f, x1, tol, nmax )
c=.8;
N=10;
x2 = ones(N,1);
x1 = transpose(x2);
meu=1:N;
meu=(meu-.5)/N;
meu=meu';
cs=.5*c/N;
ChH= meu';
in = @(x1) sum((ChH'*x1)./(bsxfun(@plus, ChH',ChH)));
n2=ones(N,1)';
f = @(x1)x1 - (n2-(cs*(in(x1)))).^-1
f0 = f(x1)
df = diffjac(x1,f,f0)
0 个评论
回答(4 个)
Matthew
2015-4-23
Hi Branden,
What are the results of
which diffjac -all
?
If its empty, then you need to add the folder diffjac is in to your path. If its not, then diffjac is written for a different type of object, and to use it you will need to overload it and define your desired behavior from it.
0 个评论
Ahmet Cecen
2015-4-23
diffjac.m and dirder.m works perfectly fine for me. Your inputs must be different than intended.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!