I'm newbie in MATLAB. I get confused to compare all possible combination column in matrix. Assume that I have an input data as a matrix 100x4. I want to compare all columns with corrcoef function (built in matlab) and save the result. So, the total combination will N*(N-1)/2.
clc
clear all
close all
load input;
% data will be a matrix with 100x4
[N,nu] = size(input);
R1_2 = corrcoef(input(:,1),input(:,2));
R1_3 = corrcoef(input(:,1),input(:,3));
R1_4 = corrcoef(input(:,1),input(:,4));
R2_3 = corrcoef(input(:,2),input(:,3));
R2_4 = corrcoef(input(:,2),input(:,4));
R3_4 = corrcoef(input(:,3),input(:,4));
I think it can be solved by 'for loop'. Anybody can help how to solve this problem? Thank you