Matrix regression- how to make?
이전 댓글 표시
Hi . I am completely new in Matlab and programming in general. I am trying to find a polynomial which would convert values from my image data to the mean value of this array. right now I have something like that:
A= importdata( '1slide.tif');
% Rewrite the image in matrix
B= im2uint16(A);
% Find the mean value
M=mean2(B);
E= ones (2048,2048,'uint16');
Mat = M *(E);
Poly= polyfit(B,Mat,6);
A= importdata( '1slide.tif');
% Rewrite the image in matrix
B= im2double(A);
% Find the mean value
M=mean2(B);
E= ones (2048,2048,'double');
Mat = M *(E);
Poly= polyfit(B,Mat,6)
But I got an error:
Undefined function 'qr' for input arguments of type 'uint16'.Error in polyfit (line 66)[Q,R] = qr(V,0);
Why do I need these QR? What should I use for them?
답변 (1개)
The input arguments to polyfit are not supposed to be matrices and they are not supposed to be of integer type. Polyfit will perform a single 1D polynomial fit to a vector of x,y data (singles or doubles) that lie on the polynomial.
To better advise, we'd have to know what you're expecting by passing matrices to polyfit instead of vectors.
카테고리
도움말 센터 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!