Issue using Auto Differentiation

1 vue (au cours des 30 derniers jours)
Sunetra CV
Sunetra CV le 14 Fév 2020
Commenté : Sunetra CV le 14 Fév 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 commentaire
Sunetra CV
Sunetra CV le 14 Fév 2020
Issue resolved. I was using an older version of matlab thats not compatible with the current version of AutoDiff.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Surfaces, Volumes, and Polygons dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by