Numerical Differentiation in for loop

4 ビュー (過去 30 日間)
David Fariyike
David Fariyike 2020 年 6 月 17 日
コメント済み: David Fariyike 2020 年 6 月 17 日
I have solved for the end point positions of an end effector of a robot and I am now looking to find the joint and end point velocities. I have created a for loop to solve for the thetas and endpoint position on the robot.
tt=t0:0.05:tf;
for ii=1:length(tt)
end
I ended up getting this but it does not work in the for loop. Rather it does after I take it out of the for loop and put it back in,but I cannot call on any of the instances. I used some form of diff() function but that didn't work either.
thetadot1 = gradient(theta1inv(:)) ./ gradient(tt(:));
I need it to work in the for loop because I am essentially trying to do this.
The theta and theta_dot are changing. I would like to determine endpoint and joint velocity and eventually call on them so I can plot velocity vs time for each.
  4 件のコメント
David Hill
David Hill 2020 年 6 月 17 日
Are your inputs arrays? It would be beneficial to buffer and accumulate arrays of inputs at your sample rate. Processing would be much more efficient. I was assuming your inputs were arrays.
David Fariyike
David Fariyike 2020 年 6 月 17 日
Yes my inputs are arrays. For the 2nd for loop the inputs are endpoint data (position along quater circle and theta of end effector obtained from 1st for loop).
for ii=1:length(tt),
R=.25;
xed=.1+R*cos((-1*pi*tt)/4);
yed=.25+R*sin((-1*pi*tt)/4);
I would also like for my differentiation to be an array so that I can call on it and plot all the instances.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeRobotics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by