Issue resolved. I was using an older version of matlab thats not compatible with the current version of AutoDiff.
Issue using Auto Differentiation
1 view (last 30 days)
Show older comments
I have been facing a problem using AutoDiff. Its showing an error when i try to use the code given in Example 6 in the documentation.
% initialize audi grid
[u,v] = ndgrid(linspace(-pi,pi));
[u,v] = ainit(u,v,2);
% define parametrization of a Klein bottle
r = 2;
x = (r+cos(v/2)*sin(u)-sin(v/2)*sin(2*u))*cos(v);
y = (r+cos(v/2)*sin(u)-sin(v/2)*sin(2*u))*sin(v);
z = sin(v/2)*sin(u)+cos(v/2)*sin(2*u);
S = [x;y;z];
% differential geometry
J = ajac(S); % Jacobian
Error using <=
Matrix dimensions must agree.
Error in audi/sumidx (line 1334)
f =
[find(all(J(1:nchoosek(nn+sum(p)-1,nn),:)<=p,2));i];
Error in audi (line 48)
sumidx(r);
Error in ainit (line 42)
varargout{i} = audi(varargin{i},i,n,k);
Answers (0)
See Also
Categories
Find more on Surfaces, Volumes, and Polygons 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!