Correlation between two vectors?

前端 未结 4 1683
轻奢々
轻奢々 2021-02-18 18:54

I have two vectors:

A_1 = 

      10
      200
      7
      150

A_2 = 
      0.001
      0.450
      0.0007
      0.200

I would like to know

4条回答
  •  伪装坚强ぢ
    2021-02-18 19:47

    For correlations you can just use the corr function (statistics toolbox)

    corr(A_1(:), A_2(:))
    

    Note that you can also just use

    corr(A_1, A_2)
    

    But the linear indexing guarantees that your vectors don't need to be transposed.

提交回复
热议问题