時系列に合わせて、三次元プロットを線で結びたい
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
歩行中の膝、すね、足首、踵、つま先の三次元データがあり、それらを線で結び、図で書きたいです。
sampledataの内容を以下に記載します。
1~3列:膝のx,y,z座標
4~6列:脛のx,y,z座標
7~9列:足首のx,y,z座標
10~12列:踵のx,y,z座標
13~15列:つま先のx,y,z座標
行:時系列データ。100Hzでサンプリング
それぞれ三次元座標でプロットし、
膝とすね、すねと足首、足首とつま先、つま先と踵、踵と足首、足首と膝の6本の線を描きたいです。
添付した画像のようなイメージです。
また、それらを時系列データに合わせ、ストロボモーションのような形でplotできればと考えております。
もし良い方法ありましたら、ご教示いただけますと幸いです。
よろしくお願いいたします。
0 Kommentare
Akzeptierte Antwort
Atsushi Ueno
am 27 Mär. 2023
load(websave('s.mat','https://jp.mathworks.com/matlabcentral/answers/uploaded_files/1337689/sampledata.mat'));
ofs = [0 3 6 12 9 6 0]; % 膝とすね、すねと足首、足首とつま先、つま先と踵、踵と足首、足首と膝
h = plot3(sampledata(1,1+ofs),sampledata(1,2+ofs),sampledata(1,3+ofs),'-or','LineWidth',3,'MarkerSize',10); % それぞれ三次元座標でプロット
grid on; xlim([0 500]); ylim([-1300 -400]); zlim([0 500]);
for r = 1:size(sampledata,1) % 行:時系列データ
h.XData = sampledata(r, 1+ofs);
h.YData = sampledata(r, 2+ofs);
h.ZData = sampledata(r, 3+ofs);
drawnow; % 時系列データに合わせ、ストロボモーションのような形でplot
pause(0.01); % 100Hzでサンプリング
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu ライン プロット finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!