Rank deficient error, how to avoid it

27 vues (au cours des 30 derniers jours)
Daniel Mbadjoun
Daniel Mbadjoun le 20 Nov 2019
Modifié(e) : Adam Danz le 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 commentaires
Daniel Mbadjoun
Daniel Mbadjoun le 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 le 20 Nov 2019
Modifié(e) : Adam Danz le 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

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by