Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
lsqlin- matrix badly scaled

Subject: lsqlin- matrix badly scaled

From: Saad

Date: 30 Nov, 2012 18:04:07

Message: 1 of 1

Dear all,

I would appreciate any comment or help on this. I have to solve a constrained linear squared problem with lsqlin which is defined as follows:

min sum(xi - dataA )^2 subject to sum(xi*dataB)=Constant
xi...xn

             n = 3000;
          
            Aeq = vertcat(ones(1,n),Data B) ;
          beq=matrix of constant (i.e. constraints)
            lb = zeros(n,1) ;
            H = eye(n) ;
            
            Please correct me if i am wrong but i think by using lsqlin my problem is translated this way: (i may be wrong)
            [x,fval] = lsqlin( sqrt(1/2).*H, sqrt(1/2).*dataA ,[],[], Aeq,beq,lb,[],initial guess, []);

I keep getting the message "Warning: Matrix is singular, close to singular or badly scaled." ( i have also tried to optimize the problem with fmincon but i get the same message)

I understand that the matrix is ill conditioned but I honestly don't know how to fix that. Any advice would be much appreciated. Thanks a lot

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us