Compare Raw Data to Actual Circle

I need to compare my raw data from a motion capture system to an actual circle in the environment. I ask participants to trace a circle with an object for around a minute. I have the data from their actual performance, but want to compare it to the physical circle they are to trace in the environment.
The data is exported in x & y-coordinates. As of now, I have been using just the x-coordinates for analyses. The biggest problem I am facing is that particpants vary in the number of times they complete the circle during the time given.
At this stage I just need to compare their performance to the actual circle in the environment, relative to how many times they complete the circle (if that matters) so I can see how they improved.
Any help will be greatly appreciated.

댓글 수: 2

Fangjun Jiang
Fangjun Jiang 2011년 8월 9일
Not sure what do you mean "compare". What results do you expect? Please provide some example data.
Joel
Joel 2011년 8월 10일
There is too much data to give as an example. Basically, I have a circle on the ground that an object follows. I have the data for where the object is during the trial, but want to compare it to the actual circle on the ground. I am thinking a way of calculating the radians (just looking at the x-coordinates part of the data) but do not really know where to go from there. I also think frequency is an issue.

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

 채택된 답변

bym
bym 2011년 8월 9일

0 개 추천

I hope this will help
clc;clear;close
x=3.5*cos(linspace(0,2*pi))+rand(1,100);
y=3.5*sin(linspace(0,2*pi))+rand(1,100); % some data
x=x'; y=y';
plot(x,y,'.')
b = [x,y,ones(size(x))]\-(x.^2+y.^2); % best fit circle
ang = atan2(y,x);
xc = -b(1)/2;
yc = -b(2)/2;
radius = sqrt((xc^2+yc^2)-b(3));
xhat = radius*cos(ang)+xc;
yhat = radius*sin(ang)+yc;
hold on
plot(xhat,yhat,'g*')
axis equal
rmse = sqrt(sum(hypot(x-xhat,y-yhat))./numel(x))

댓글 수: 3

Joel
Joel 2011년 8월 10일
It is helping by leading me in some directions.
As of now (for the best fit circle equation) I am getting Warning: Rank deficient, rank = 1, tol = 2.9207e-010. Which gives me the Value [0;0;NaN].
My data may be too large (<12005x1 double>), I think i may need to only look at the x-coordinates and calculate the error using radians?
Does that sound like something that could work?
-Thank you very much for your time
bym
bym 2011년 8월 10일
How is <12005 x 1> a set of x & y coordinates? The data is not too large, perhaps you can post 10 or so lines. Also, I am confused about your statement "I also think frequency is an issue"
Joel
Joel 2011년 8월 12일
Sorry:<12005 x 2>***
For some reason there was an extra data point in one of my columns which was messing up the last row for the y column. You are correct, the data is not too large and your original answer is working perfectly! Thank you very much for your time.
-The reason I think frequency is an issue is because I am still trying to compare their actual data to the original circle, not a best fit, as another measure. If I plot just the x values, each trial has a different number of cycles (e.g. trial 1 = 6pi; trial 2 = 8pi), so I am also trying to plot the performance x values relative to where the circle actually is in the physical environment. I cannot figure out how to successfully do that with respect to how many times they completed the circle.
Any ideas on that will be greatly appreciated but again, thank you for your original answer!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

질문:

2011년 8월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by