corrcoef help with accounting for zeros in upper triangular section of matrix

6 vues (au cours des 30 derniers jours)
Gregory jones
Gregory jones le 27 Déc 2016
Commenté : Gregory jones le 28 Déc 2016
Hi Guys,
I have an array that looks something like this A = [0.5; 0.6, 0.8; 0.3, 0.2, 0.5]
I'm looking to run a corrcoef function on it but I don't want it to include the zero values in the upper triangular section that will be created when the matrix is created. Would anyone be able to help out with a lil bit of code which will ignore the upper triangular when I run corrcoeff please?
(As far as I know I need to ignore these so they aren't included as part of the N value in the equation).
Thanks in advance, your help is hugely appreciated.
  2 commentaires
the cyclist
the cyclist le 27 Déc 2016
That specification of A will give an error.
Also, can you post the actual code that you expect to give zeros in the upper triangular part of the result. I don't understand what you mean.
Gregory jones
Gregory jones le 28 Déc 2016
Fortunately I have been able to fix my issue by assigning the lower diagonal to a variable so that the diagonal is shown as a column vector, this has then allowed me to run my Pearson Correlation Coefficient, but thank you for the quick response!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements 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