Is there any way to calculate R^2 (correlation coefficient) in Matlab directly?

1 vue (au cours des 30 derniers jours)
I would like to calculate R^2 in easy way in matlab? How can I do that?
Thanks in advance
Riyadh

Réponse acceptée

the cyclist
the cyclist le 14 Juin 2016
The corrcoef function calculates correlation.
  3 commentaires
the cyclist
the cyclist le 15 Juin 2016
Modifié(e) : the cyclist le 15 Juin 2016
I'm confused by your comment. For example,
x1 = [1; 2; 3; 4];
x2 = [7; 5; 3; 2];
correlation = corr(x1,x2)
gives a single, negative number for the correlation of these two vectors of numbers.
Riyadh Muttaleb
Riyadh Muttaleb le 15 Juin 2016
Modifié(e) : Riyadh Muttaleb le 15 Juin 2016
Thank you so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by