필터 지우기
필터 지우기

How to do a ttest2 between two 4D matrices?

조회 수: 1 (최근 30일)
HA
HA 2018년 4월 20일
편집: Matt J 2018년 4월 20일
I have two 4D matrices that I would like to do a ttest2 between to determine their relation at each point. The problem is that ttest2 only does the first element of the matrices, so I end up with a new matrix of dimension 1x128x17x12 from 64x128x17x12.
I have tried doing a for loop through:
for q=1:64
A(q,:,:,:)=ttest2(B,C);
end
However this just repeats the ttest for (1,:,:,:) for all 64 loops. I have tried putting the loop in each of B and C and even tried a nested loop but I end up getting the same problems.
Is there anyway I can get the full 4D matrix for each point from ttest2?

채택된 답변

Matt J
Matt J 2018년 4월 20일
편집: Matt J 2018년 4월 20일

I have tried doing a for loop through... for q=1:64

Meaning you want 64 t-test results? If so, then you could do as follows

A = ttest2(B(:,:).', C(:,:).')
  댓글 수: 2
HA
HA 2018년 4월 20일
not quite, I would like a final matrix output of 64x128x17x12, that way I can tell which parts of the two are similar, and therefore plot only the significant results? Is there anyway to do this with ttest2?
Thank you for your reply, it may well be that I am using the wrong statistical test for what I want to do perhaps?
Matt J
Matt J 2018년 4월 20일
편집: Matt J 2018년 4월 20일
But what are the dimensions of B and C? Which dimension corresponds to the different samples/observations on which each individual test result will be based?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by