Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7857421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:02:43+00:00 2026-06-02T21:02:43+00:00

I have some vectors, for example, let´s call them a, b and c. All

  • 0

I have some vectors, for example, let´s call them a, b and c. All of them have the same size. I want to get the correlation between a and c, b and c.

I have tried that:

[rho1,pval1]=corr(a,c,’rows’,’complete’)
[rho2,pval2]=corr(b,c,’rows’,’complete’)


rho1=0.1054
pval1=0.2918
rho2=0.1174
pval2=0.2473


And I have thought that the results were OK, but later I have tried that:

[rho,pval]=corr([a b],c,’rows’,’complete’)

And have given me different results:


rho=
0.1168
0.1150

pval=
0.2649
0.2726


Matlab´s help says that these function returns a p1-by-p2 matrix containing the pairwise correlation coefficient between each pair of columns in the n-by-p1 and n-by-p2 matrices X and Y.

What am I doing wrong?
Thanks.

Note: The vectors are 289×1, so I can´t write them here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:02:43+00:00Added an answer on June 2, 2026 at 9:02 pm

    SOLVED.The problem is that these vector have NaN’s so the option ‘complete’ only takes the rows where there are no NaN’s.If a vector (for example b) have a NaN will affect to the results of both correlations (a and b). The option that I need is ‘pairwise’. Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some vectors of experimental data that I need to massage, for example:
I have been struggling to think of some decent uses for things like vectors
I have some numbers stored in a std::vector<int> . I want to find which
I have some data structures: all_unordered_m is a big vector containing all the strings
I have some files that are uuencoded, and I need to decode them, using
Let's say I have a program(C++, for example) that allocates multiple objects, never bigger
Let's say I have some code that does some floating point arithmetic and stores
I have two large vectors, I am trying to do some sort of element
I'd like to output some data to a file. For example assume I have
I have a problem were i need to aggregate some vectors in order to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.