Hi All,
I am trying to plot two .mat files using a function that was previously made. The function is used to plot only one set of .mat files data. Thus, in each figures it represents only one set of data. My intention is to use two sets of data and plot it in the same figures, if possible figure (1) and figure (2). So the data that will be plot would be the 'NouMovement0001.mat' and the other one is 'NouMovement0002.mat'. In the 3D plot, I should be able to distinguish between these datas by color coding it like for example in the figure (2) right?
Please let me know as I am trying to figure out how to actually plot these two sets of .mat files datas. Do I have to redefine to combine both datas or is there another way to plot this.
fileName = 'NouMovement0001';
curDir = pwd;
Data = load_qualisys_mat(curDir, fileName);
Markers = Data.Markers ;
figure(1)
iFrame = 1000 ;
Fields = fieldnames(Markers) ;
draw_stick_picture(Markers,Fields,iFrame,'xyz', 'ko')
axis equal
grid on
figure(2)
plot(Markers.RAnkle(:,3), 'b') ; hold on
plot(Markers.LAnkle(:,3), 'r') ;
As you can see, there are two figures, I am grateful if any of you able to guide me at least one of them. The first figure is a 3D graph and the load_qualisys_mat is the function that was made prior to this.
Thanks.

댓글 수: 7

madhan ravi
madhan ravi 2018년 12월 23일
upload your mat files
Guillaume
Guillaume 2018년 12월 23일
Maybe I'm blind, but I can't see an actual question or any description of a problem.
madhan ravi
madhan ravi 2018년 12월 23일
me neither
SYAFIQ FALIQ ALFAN
SYAFIQ FALIQ ALFAN 2018년 12월 23일
Thanks, I have attached the zip file of these two mat files. Please check it out.
SYAFIQ FALIQ ALFAN
SYAFIQ FALIQ ALFAN 2018년 12월 23일
I have updated my queries. Is it clear enough?
Are Mjaavatten
Are Mjaavatten 2018년 12월 23일
Still not easy to guess what you are trying to do. I think we need to be able to run your code, so please upload load_qualisys_mat.m and draw_stick_picture.m plus any functions used by those functions.
SYAFIQ FALIQ ALFAN
SYAFIQ FALIQ ALFAN 2018년 12월 23일
Noted. I have uploaded the files! Thanks for mentioning it.

댓글을 달려면 로그인하십시오.

 채택된 답변

Etsuo Maeda
Etsuo Maeda 2018년 12월 26일

0 개 추천

Hi Syafiq Faliq Alfan,
Christmas season has come. I am also blind as Guillaume and Madhan Ravi mentioned. But the following code should be okay for you.
clear; close all;
fileName1 = 'NouMovement0001';
curDir1 = pwd;
Data1 = load_qualisys_mat(curDir1, fileName1);
Markers1 = Data1.Markers ;
fileName2 = 'NouMovement0002';
curDir2 = pwd;
Data2 = load_qualisys_mat(curDir2, fileName2);
Markers2 = Data2.Markers ;
subplot(1, 2, 1)
grid on
hold on
iFrame1 = 1000 ;
Fields1 = fieldnames(Markers1) ;
draw_stick_picture(Markers1,Fields1,iFrame1,'xyz', 'o')
iFrame2 = 1000 ;
Fields2 = fieldnames(Markers2) ;
draw_stick_picture(Markers2,Fields2,iFrame2,'xyz', 'o')
legend('NouMovement0001', 'NouMovement0002', 'Location', 'northeast');
view(3)
hold off
subplot(2, 2, 2)
hold on
plot(Markers1.RAnkle(:,3), 'b') ;
plot(Markers1.LAnkle(:,3), 'r') ;
legend('NouMovement0001_1', 'NouMovement0001_2')
ylim([0 200])
hold off
subplot(2, 2, 4)
hold on
plot(Markers2.RAnkle(:,3), 'b') ;
plot(Markers2.LAnkle(:,3), 'r') ;
legend('NouMovement0002_1', 'NouMovement0002_2')
ylim([0 200])
hold off
HTH

댓글 수: 2

SYAFIQ FALIQ ALFAN
SYAFIQ FALIQ ALFAN 2018년 12월 26일
Hi Maeda!
Thank you so much for anwering this question. Indeed this looks like the one that I've been looking for. Which is to plot and compare between two sets of data. Hope you had a great time with family during Christmas. God bless.
Etsuo Maeda
Etsuo Maeda 2018년 12월 26일
Hi Syafiq,
Wishing you all the best with the project. And I hope you have a nice days with your loved ones.
Etsuo

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Biomedical Signal Processing에 대해 자세히 알아보기

질문:

2018년 12월 23일

댓글:

2018년 12월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by