Mean of an array with array elements

2 vues (au cours des 30 derniers jours)
fadams18
fadams18 le 23 Oct 2018
Modifié(e) : madhan ravi le 23 Oct 2018
I have the code below.
rRE_NeNMF_R=[2,2];
rRE_NeNMF_V=[2,2];
rRE_MU_R=[2,2];
rRE_MU_V=[2,2];
rRE_ALS_R=[2,2];
rRE_HALS_R=[2,2];
rRE_PG_R=[2,2];
Data=[rRE_NeNMF_R, rRE_NeNMF_V,rRE_MU_V,rRE_MU_R,rRE_ALS_R,rRE_HALS_R,rRE_PG_R];
Since I want to find the mean of all the elements, i dont want to do them one by one. its too much. is there a way to this? so in effect, i should get somethin like Data=[2,2,2 .....]

Réponses (1)

madhan ravi
madhan ravi le 23 Oct 2018
Modifié(e) : madhan ravi le 23 Oct 2018
>> rRE_NeNMF_R=[2,2];
rRE_NeNMF_V=[2,2];
rRE_MU_R=[2,2];
rRE_MU_V=[2,2];
rRE_ALS_R=[2,2];
rRE_HALS_R=[2,2];
rRE_PG_R=[2,2];
Data = [rRE_NeNMF_R; rRE_NeNMF_V;rRE_MU_V;rRE_MU_R;rRE_ALS_R;rRE_HALS_R;rRE_PG_R]
Data = mean(Data,2)'
Data =
2 2
2 2
2 2
2 2
2 2
2 2
2 2
Data =
2 2 2 2 2 2 2
>>
  1 commentaire
madhan ravi
madhan ravi le 23 Oct 2018
Modifié(e) : madhan ravi le 23 Oct 2018
You should replace , with ; and then if you transpose you will get the desired result , try the above now , if it's upto your requirements accept the answer so that other people know the question is solved else let know what's additionally required

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by