Asked by Carlotta Fabris
on 16 Mar 2019

Hi!

I have a 12x1 vector, and a value. I would like to find the correlation of each of the vector values with my variable. How can I do it?

I tried with corr, corrcoef, corr2 and I only got NaN, why is that?

To clarify my vector is

x = [0.0000827

0.000229

0.000358

0.000486

0.000561

0.000564

0.00483

133

167

178

213

386

];

and my value is y = 2.261133333.

Any suggestions?

Thank you,

Carlotta.

Opportunities for recent engineering grads.

Apply Today
## 10 Comments

## Jos (10584) (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_681737

## Carlotta Fabris (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_681762

## Jeff Miller (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_681911

## Carlotta Fabris (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_682004

## Jos (10584) (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_682027

## Carlotta Fabris (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_682029

## Image Analyst (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_682056

## Carlotta Fabris (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_682098

## Image Analyst (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_682105

## Carlotta Fabris (view profile)

Direct link to this comment:https://www.mathworks.com/matlabcentral/answers/450397-right-correlation-formula-to-use#comment_685370

Sign in to comment.