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)
1 view (last 30 days)
Show older comments
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 Comments
Answers (4)
Matthew
on 23 Apr 2015
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 Comments
Ahmet Cecen
on 23 Apr 2015
diffjac.m and dirder.m works perfectly fine for me. Your inputs must be different than intended.
0 Comments
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!