How to apply Polyfit to a cell array
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a Cell array of size 1x512 (spatiotemporal data), inside which each element of cell array holds a 2D matrix of size 127 X 65. now I want to apply a 6th order polyfit function to all pixel locations evolving in time. I have successfully applied it to a single pixel location evolving in time but not to the whole cell array. The code is as following:
for ii=1:512
DATA(ii)=mycell_opd{1,ii}(39,44);
end
DATA=DATA.*10^9;
t = (1:length(DATA));
opol = 6;
[p,s,mu] = polyfit(t,DATA,opol);
f_y = polyval(p,t,[],mu);
dt_ecgnl = DATA - f_y;
figure(1); plot(DATA); title('data showing trends')
figure(2); plot(dt_ecgnl); title('data after removing trends')
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!