How to do a ttest2 between two 4D matrices?

1 visualización (últimos 30 días)
HA
HA el 20 de Abr. de 2018
Editada: Matt J el 20 de Abr. de 2018
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?

Respuesta aceptada

Matt J
Matt J el 20 de Abr. de 2018
Editada: Matt J el 20 de Abr. de 2018

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 comentarios
HA
HA el 20 de Abr. de 2018
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 el 20 de Abr. de 2018
Editada: Matt J el 20 de Abr. de 2018
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?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by