How can I use the lagrangepoly() function on the ecg data
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to use lagrangepoly function on ecg data but it dosen't gives any plot and when I quit debugging, Matlab opens up ''poly.m'' file.
load noisyecg.mat;
x=noisyECG_withTrend;
t=1:length(noisyECG_withTrend)
baseline=linspace(min(t),max(t), length(t));
P = lagrangepoly(t,x);
plot(baseline,polyval(P,baseline),x,t);
댓글 수: 4
dpb
2019년 8월 5일
"baseline= linspace(1,t,t) it gives an error t"
Well, yes, it should. t is already a vector of 1:N where N is the length of your time series.
I was just pointing out that your definition of baseline is no different than the t vector you've already got--there's no purpose in creating two copies of the same thing. I don't follow what your thinking must be in having done so.
What is length(noisyECG_withTrend)?
Looks to me like you've probably just exceeded the limits of the length of the series poly can manage to solve
p = poly(r), where r is a vector, returns the coefficients of the polynomial
whose roots are the elements of r.
That's asking a lot if length(r) is really large as I'm guessing it probably is.
Try doing the calculation in pieces instead and see if can't manage that way (altho I still think it's a Don Quixote-type mission; I see no practical purpose in doing this).
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Bartlett에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!