How to describe the table of multiple variable correlation in MATLAB similar R?

조회 수: 3 (최근 30일)
Khanh Dang
Khanh Dang 2022년 4월 19일
답변: Yash 2024년 1월 11일
Hi, brothers
I have the correlation matrix of 8 independent variables, but I want to describe the results under an integrated table similar R-language (pls see picture). I ask for a help that there is avaible Tool to do it in MATLAB or not? or must write a private code in MATLAB for this?
Thank you for your attention!

답변 (1개)

Yash
Yash 2024년 1월 11일
Hi Khanh,
In MATLAB, you do not have a built-in function that directly mimics the "cor" function from R in terms of both computing and displaying a correlation matrix. However, you can certainly compute the correlation matrix using the "corr" function and then display it in a table format using MATLAB's "array2table" function or other formatting methods. You can use the "subplot" function to plot multiple graphs in a single figure as you have referred.
Here are the documentation links for the functions mentioned above:
  1. corr: https://www.mathworks.com/help/stats/corr.html
  2. array2table: https://www.mathworks.com/help/matlab/ref/array2table.html
  3. subplot: https://www.mathworks.com/help/matlab/ref/subplot.html
In short, you have to write manual code to achieve the desired results, there is no inbuilt function to perform the exact same task.
Hope this helps

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by