Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
error: Index exceeds matrix dimensions.
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%This begins the force analysis
for turn=['a','b','c','d','e','f','g']
r.(turn).r3=.331;
r.(turn).force=r.(turn).force(:,2);
r.(turn).v=length(r.(turn).force);
r.(turn).justtime=r.(turn).justtime(1:r.(turn).v);
r.(turn).justangle=r.(turn).justangle(1:r.(turn).v);
r.(turn).sinangle=sin(r.(turn).justangle);
r.(turn).nettorque=(r.(turn).r3)*(r.(turn).sinangle).*(r.(turn).force);
for b=1:(r.(turn).v);
r.(turn).deltatorque(b)=r.(turn).nettorque(b+1)-r.(turn).nettorque(b);
end
r.(turn).deltatorque=r.(turn).deltatorque.';
r.(turn).network=(r.(turn).nettorque(1:r.(turn).v)).*(r.(turn).deltatheta(1:r.(turn).v));
r.(turn).deltapotential=(r.(turn).nettorque).*(r.(turn).justangle);
r.(turn).gravity=(9.81*(r.(turn).m))*(r.(turn).deltatheta);
r.(turn).withoutgravity=(r.(turn).deltapotential(1:r.(turn).v))-(r.(turn).gravity(1:r.(turn).v));
r.(turn).totalwork=sum(r.(turn).withoutgravity);
fprintf('The Total Work is %f\n',r.(turn).totalwork)
end
1 commentaire
per isakson
le 26 Fév 2015
Modifié(e) : per isakson
le 26 Fév 2015
It's difficult to spot the cause of the error by inspection. The problem might even be with the input data rather than this code.
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!