Rank deficient error, how to avoid it

28 views (last 30 days)
Daniel Mbadjoun
Daniel Mbadjoun on 20 Nov 2019
Edited: Adam Danz on 20 Nov 2019
QTU = QTU(:), HB=HB(:), P=P(:) ;
HBinv=1./HB;
nqtu = length(QTU) ;
U = ones(nqtu, 1) ;
M = [U P HBinv P.^2 P.*HBinv HBinv.^2]
K = M\QTU
QTU_modele = M*K ;
residus = QTU-QTU_modele;
variance_d_origine = var(QTU) ;
variance_expliquee = var(QTU_modele) ;
variance_residuelle = var(residus) ;
coefficient_correlation_r2 = variance_expliquee/variance_d_origine
  4 Comments
Daniel Mbadjoun
Daniel Mbadjoun on 20 Nov 2019
The error show by Matlab is:
In Modele_propre_ (line 8) % K = M\QTU
Warning: Rank deficient, rank = 5, tol = 1.996410e-05.
K =
I obtain result of my program:
K =
4.513991002279457e+01
2.745762097557862e+00
-1.766261490412594e+03
5.146399884933867e-06
3.632648174417475e+00
0
coefficient_correlation_r2 =
9.998090847065179e-01
This result approaches the model.
The line which cause the error is:
K= M\QTU
How can i correct the error?
Adam Danz
Adam Danz on 20 Nov 2019
Edited: Adam Danz on 20 Nov 2019
If that line is causing the error, look into the values of M and QTU.
The message you shared shows a warning, not an error.
Perhaps this will help

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!