Issue using Auto Differentiation

2 views (last 30 days)
Sunetra CV
Sunetra CV on 14 Feb 2020
Commented: Sunetra CV on 14 Feb 2020
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);
  1 Comment
Sunetra CV
Sunetra CV on 14 Feb 2020
Issue resolved. I was using an older version of matlab thats not compatible with the current version of AutoDiff.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!