"Matrix close to singular or badly scaled" after using squeeze function for mnrfit

조회 수: 3 (최근 30일)
Lulu Dulac
Lulu Dulac 2017년 6월 30일
댓글: Jan 2017년 6월 30일
Hi all!
I am trying to use mnrfit on two matrices, but get the following error message:
> In mnrfit>nominalFit (line 455)
In mnrfit (line 202)
In samplecode(line 28)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 4.731375e-21.
My matrix A has 1 column and 200 rows, and my matrix B has 300 columns and 200 rows. I think the problem may be due to how I define B:
B = squeeze(data(:,50,:));
Indeed data is a 3D matrix and I want it to be a 2D matrix.
Once I have B, I simply do:
C = mnrfit(B,A);
Any help would be very much appreciated Many thanks
  댓글 수: 3
Lulu Dulac
Lulu Dulac 2017년 6월 30일
편집: Lulu Dulac 2017년 6월 30일
Thank you a lot for your answer. The full error message is
>> samplecode
> In mnrfit>nominalFit (line 455)
In mnrfit (line 202)
In samplecode (line 28)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 6.968113e-21.
> In mnrfit>nominalFit (line 455)
In mnrfit (line 202)
In samplecode(line 28)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 4.731375e-21.
Operation terminated by user during mnrfit>nominalFit (line 449)
In mnrfit (line 202)
[b,hess,pi] = nominalFit(x,y,m,pi,n,k,p,pstar,parallel);
In samplecode(line 28)
C = mnrfit(B,A);
I am not sure how to provide the values as there are so many, but for A they range from -3 to 3 (e.g., -1,18217390027104 0,578412947454769 0,917299333541635 0,544267094172225 1,06462747652037 -1,69546501866701) and for B they range from 1 to 8 (only nondecimal numbers)
Jan
Jan 2017년 6월 30일
You can create a MAT file by save and attach it here in the forum.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by