Info
此问题已关闭。 请重新打开它进行编辑或回答。
error: Index exceeds matrix dimensions.
7 次查看(过去 30 天)
显示 更早的评论
%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 个评论
per isakson
2015-2-26
编辑:per isakson
2015-2-26
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.
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!