Kruskalwallis test to struct

3 vues (au cours des 30 derniers jours)
Ziv Kassner
Ziv Kassner le 14 Juin 2015
Modifié(e) : Matt J le 14 Juin 2015
I have a 1X4 struct array with fields that contains different dimensions of matrices and I want to check if there is a difference between the different means. the problem is the dimensions of the data. how can I solve it?
  1 commentaire
Jan
Jan le 14 Juin 2015
Please post what you have tried so far. The current description is too general to give a useful advice. Add the relevant part of the code by editing the question, not by adding a comment. Thanks.

Connectez-vous pour commenter.

Réponses (1)

Matt J
Matt J le 14 Juin 2015
Modifié(e) : Matt J le 14 Juin 2015
A for-loop would work fine, but if you want to be a little fancier, you can use arrayfun,
fun=@(i) mean(yourStruct(i).yourField(:));
Means=arrayfun(fun,1:4);
I assumed here that you wanted the total mean over all elements in each matrix -- it was a little unclear -- but it should be a starting point for whatever it is you really want.

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by