how to plot ellipse around poincare map of RR intervals
18 次查看(过去 30 天)
显示 更早的评论
Hello guys, i have poincare map (where on x is RR interval and on y axis is RR interval+1) and i want to plot ellipse around this poincare map.
My code:
figure()
subplot(131)
plot(RR_x_1,RR_y_1,".")
axis([-2e5 10e5 0e5 10e5])
title("0-5min 4km/hod")
subplot(132)
plot(RR_x_2,RR_y_2,".")
axis([-2e5 10e5 0e5 10e5])
title("5-10min 8km/hod")
subplot(133)
plot(RR_x_3,RR_y_3,".")
axis([-2e5 10e5 0e5 10e5])
title("10-15min 10km/hod")
This is output of my code - poincare maps :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/960540/image.jpeg)
2 个评论
fatemeh shoeibi
2022-7-31
hello Dominik
I have one question about poincare map of RR-interval. after mapping ,some of points are in the same cordinate. what unit is your horizontal and vertical axies?(second or milisecond).Is it possible for you to consider and look into this matter and answer my question?
i think the I reason the points(dot markers in your graph) overlap is because the heartbeat is repetitive in nature.
is it right?
thanks for your attention.
fatemeh
William Rose
2022-8-1
Since the mean value of the plotted RR interval is aproximately 3.5E5, I think his units must be microseconds. This would correspond to a heart rate of approximately170 beats per minute. This could from a human during exercise, or from a laboratory rabbit at rest.
回答(2 个)
William Rose
2022-4-21
Here is code that draws an ellipse that is designed to capture 95% of the data points. By adjusting a value in the code, you could chage it to capture approximately 90% or 99%, etc. The ellipse size is based on the assumption that the data are independently normally distributed about perpendicular axes, which may not be the X and Y axes. The actual data in the attached file is the center of pressure of a blindfolded subject, recorded at 100 Hz.
% conf_ellipse.m WCR 10/17/2002, 20160303
% Draws a 95% confidence ellipse around xy data.
% Data is read in from a file.
% Plots the data, the ellipse, and the principal components.
% The number sqrt(5.99)=2.45 appears because prob(X>5.99)=0.95, if X~chi squared with 2 d.f.
% Replace 2.45 with sqrt(4.61)=2.15 to get the 90% confidence ellipse.
% Replace 2.45 with sqrt(9.21)=3.03 to get the 99% confidence ellipse.
%filename=input('Enter name of text file containing the data: ','s');
filename='copdata.txt';
d=load([filename]);
mean_d=mean(d);
cov_mtx=cov(d);
[V,D]=eig(cov_mtx);
semimaj=[mean_d;mean_d+2.45*sqrt(D(1,1))*V(:,1)'];
semimin=[mean_d;mean_d+2.45*sqrt(D(2,2))*V(:,2)'];
theta=linspace(0,2*pi,41)';
ellipse=2.45*sqrt(D(1,1))*cos(theta)*V(:,1)'+2.45*sqrt(D(2,2))*sin(theta)*V(:,2)'+ones(size(theta))*mean_d;
ellipse99area=pi*9.21*sqrt(D(1,1)*D(2,2));
ellipse95area=pi*5.99*sqrt(D(1,1)*D(2,2));
ellipse90area=pi*4.61*sqrt(D(1,1)*D(2,2));
%% Plot results.
hold off; plot(d(:,1),d(:,2),'bx'); hold on; axis equal
plot(semimaj(:,1),semimaj(:,2),'r','LineWidth',2); hold on
plot(semimin(:,1),semimin(:,2),'r','LineWidth',2); hold on
plot(ellipse(:,1),ellipse(:,2),'g','LineWidth',2)
Try the code above. Good luck.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!