MATLAB: Ttest for one row of matrix ttest Hi! I am trying to perform t-tests separately for each row of my 3×3 matrix. There is probably a standard way to do this but I can't seem to figure it out. Thank you in advance for your help! Best Answer A simple for-loop would do:Nrows = size(DATA,1)h = zeros(Nrows,1)for k = 1:Nrows h(k) = ttest(DATA(k,:))end Related SolutionsMATLAB: Index exceeds matrix dimensions Well, either data has less than 7 columns or less than nRows rows.Before the for loop insert these two lines:assert(nRows <= size(data, 1), 'data has less than nRows rows');assert(size(data, 2) >= 7, 'data has less than 7 columns');or put a breakpoint on the exportData line and check the size of data manually. MATLAB: Looping for storing differet matrix in different rows but in same matrix. Before the loop, initiateCalculated_Data=zeros(numel(alpha_data),numel(alpha_data{1,1}));k=0;within the loop, usek=k+1;Calculated_Data(k,:) = alpha_data{i,j}; Related QuestionTtest problem with alphaMake a for loop for the following codeTtest – 2 matrices
Best Answer