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

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 Comments

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.
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!

Sign in to comment.

Answers (0)

Asked:

on 27 Dec 2016

Commented:

on 28 Dec 2016

Community Treasure Hunt

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

Start Hunting!