You can return a matrix of the pairwise linear correlation coefficients between variables age, attendance, 1st exam score, 2nd exam score, and o/all score using the corr
function in MATLAB as follows:
main.m400 chars9 lines
Replace age
, attendance
, first_exam_score
, second_exam_score
, and overall_score
with the actual data vectors or matrices in your MATLAB workspace.
Make sure to have the variables defined with appropriate data before running this code snippet.
gistlibby LogSnag