Looking to animate two lines with the angle between them changing?

5 ビュー (過去 30 日間)
Ronan
Ronan 2014 年 11 月 25 日
編集済み: Andrew Reibold 2014 年 11 月 25 日
Have an EMG signal which I've used to get a range of corresponding angles. would like to have 2 lines representing an arm where the angle I have is between them. From there i would like to animate the whole process with all angles. Cannot figure out how to do this?

回答 (2 件)

Brandon
Brandon 2014 年 11 月 25 日
Are you wanting to animate this in real time or create a video file from the plot.
You may be interested in looking at these two functions:
  1 件のコメント
Ronan
Ronan 2014 年 11 月 25 日
create a video file from the plot. I cant seem to plot the lines with the associated angle?

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


Andrew Reibold
Andrew Reibold 2014 年 11 月 25 日
編集済み: Andrew Reibold 2014 年 11 月 25 日
Bro, If you are working with EMG signals you should really know how to do Highschool trig... haha :-)
But anyway, here is an example of how you could do it using Unit Circle concepts and a line of length 1! Replace angles with your angles in degrees - This one animates from 30-90. (If your angles are in Radians use sin and cos instead of sind and cosd )
figure
for angles= [30:90];
x = cosd(angles);
y = sind(angles);
plot([0,1],[0,0],[0,x],[0,y])
axis([-1.5 1.5 -1.5 1.5])
pause(.01)
end
  7 件のコメント
Andrew Reibold
Andrew Reibold 2014 年 11 月 25 日
編集済み: Andrew Reibold 2014 年 11 月 25 日
I think I am misunderstanding what you mean by raised. I am sorry.
On my plot, it already looks like the arm is being 'raised' [from the horizontal - to Vertical]...
Ronan
Ronan 2014 年 11 月 25 日
no it was to do with the level of contraction which would result in a larger EMG which would then result in a smaller angle between the upper and lower arm as you are applying more force.
Ye it does take a long time all right. will have to take a sample value every so often in the entire vector to make it run a bit quicker.

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by