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

  • SEARCH
  • Home
  • 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 9024601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:03:31+00:00 2026-06-16T06:03:31+00:00

Basically I have two matrices, something like this: > Matrix A (100 rows x

  • 0

Basically I have two matrices, something like this:

  > Matrix A (100 rows x 2 features)

  Height - Weight
  1.48      75
  1.55      65
  1.60      70
  etc...

And Matrix B (same dimension of Matrix A but with different values of course)

I would like to understand if there is some correlation between Matrix A and Matrix B, which strategy do you suggest me?

  • 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-16T06:03:32+00:00Added an answer on June 16, 2026 at 6:03 am

    The concept you are looking for is known as canonical correlation. It is a well developed bit of theory in the field of multivariate analysis. Essentially, the idea is to find a linear combination of the columns in your first matrix and a linear combination of the columns in your second matrix, such that the correlation between the two linear combinations is maximized.

    This can be done manually using eigenvectors and eigenvalues, but if you have the statistics toolbox, then Matlab has already got it packaged and ready to go for you. The function is called canoncorr, and the documentation is here

    A brief example of the usage of this function follows:

    %# Set up some example data
    CovMat = randi(5, 4, 4) + 20 * eye(4); %# Build a random covariance matrix
    CovMat = (1/2) * (CovMat + CovMat'); %# Ensure random covriance matrix is symmetrix
    X = mvnrnd(zeros(500, 4), CovMat); %# Simulate data using multivariate Normal
    
    %# Partition the data into two matrices
    X1 = X(:, 1:2);
    X2 = X(:, 3:4);
    
    %# Find the canonical correlations of the two matrices
    [A, B, r] = canoncorr(X1, X2);
    

    The first canonical correlation is the first element of r, and the second canonical correlation is the second element of r.

    The canoncorr function also has a lot of other outputs. I’m not sure I’m clever enough to provide a satisfactory yet concise explanation of them here so instead I’m going to be lame and recommend you read up on it in a multivariate analysis textbook – most multivariate analysis textbooks will have a full chapter dedicated to canonical correlations.

    Finally, if you don’t have the statistics toolbox, then a quick google revealed the following FEX submission that claims to provide canonical correlation analysis – note, I haven’t tested it myself.

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

Sidebar

Related Questions

I'm building this website and I have basically two questions about this page: http://sites.publishyours.com.br/silviamecozzi/pt/obra/deserto_das_palmas.php
I've been struggling with this for a while. Basically, I want to have two
I have two different views to the same database table and I would like
Basically I have two ways for writing something First: <?php echo link_to( static_image_tag( $object->getImageWebPath(),
I basically have two child classes which have the same parent class. what I
Basically you have two ways for doing this: for (int x = 0; x
So basically I have two types of status' and I'd like to display both
I am not quite sure how to attack this, basically I have two html
If I were to select a row from a table I basically have two
Basically I have two 2D points and there is a line between them. A

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.