MatLab + Vicon SDK plot the values
Show older comments
Hi guys, first time and mu knowledge in matlab is small, but i will try to expose my question as clear as possible.
I want to plot my data that comes out from the vicon system in real time, the current code i have i can achive this but from the 21 markers the plot values erase the previous values and I'm just interested in the 4 markers.
The Output_GetMarkerGlobalTranslation.Translation 1 is my X; 2 is my Y and 3 is my Z.
I just want the Y from marker 2,3 and 5,6. But i want to plot the 4 markers(y values only at the same time.
I attached the entire code if it helps.
% Count the number of markers
MarkerCount = MyClient.GetMarkerCount( SubjectName ).MarkerCount;
fprintf( ' Markers (%d):\n', MarkerCount );
for MarkerIndex = 0:typecast( MarkerCount, 'int32' )-1
% Get the marker name
MarkerName = MyClient.GetMarkerName( SubjectName, typecast( MarkerIndex,'uint32') ).MarkerName;
% Get the marker parent
MarkerParentName = MyClient.GetMarkerParentName( SubjectName, MarkerName ).SegmentName;
% Get the global marker translation
Output_GetMarkerGlobalTranslation = MyClient.GetMarkerGlobalTranslation( SubjectName, MarkerName );
fprintf( ' Marker #%d: %s (%g, %g, %g) %s\n', ...
MarkerIndex, ...
char( MarkerName ), ...
Output_GetMarkerGlobalTranslation.Translation( 1 ), ...
Output_GetMarkerGlobalTranslation.Translation( 2 ), ...
Output_GetMarkerGlobalTranslation.Translation( 3 ));
%Plot
bar([mean(Output_GetMarkerGlobalTranslation.Translation( 1 )) mean(Output_GetMarkerGlobalTranslation.Translation( 2 )) mean(Output_GetMarkerGlobalTranslation.Translation( 3 ))])
xlabel( 'MarkerName' );
1 Comment
Pedro Saraiva
on 13 Aug 2020
Answers (0)
Categories
Find more on Scatter Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!