Calculate the correlation coefficient between the first and the second measurement and the correlation coefficient between the first and the third measurement.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sarah Can
am 1 Okt. 2018
Kommentiert: Sarah Can
am 1 Okt. 2018
I need to help in finding the correlation coefficient between the first and the second measurement and the correlation coefficient between the first and the third measurement. Please view the attached matlab file.
Thanks for your help!
0 Kommentare
Akzeptierte Antwort
Nicole Peltier
am 1 Okt. 2018
The function corr tests correlations between pairs of variables. You can actually test the correlations between several pairs of variables in one line of code if they are stored as columns in a matrix.
C = corr([M_sensor, M_sensor2, M_sensor3]);
Then C(1,2) will be the correlation between M_sensor and M_sensor2, C(1,3) will be the correlation between M_sensor1 and M_sensor3, and C(2,3) will be the correlation between M_sensor2 and M_sensor3.
Since these three variables all came from data_all, you will get the same results by using:
C = corr(data_all(:, 1:3));
I'd recommend checking out the documentation for corr so that you can see what types of correlation tests it can perform.
Hope this helps!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Hypothesis Tests finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!