Mean of an array with array elements

3 visualizaciones (últimos 30 días)
fadams18
fadams18 el 23 de Oct. de 2018
Editada: madhan ravi el 23 de Oct. de 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 .....]

Respuestas (1)

madhan ravi
madhan ravi el 23 de Oct. de 2018
Editada: madhan ravi el 23 de Oct. de 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 comentario
madhan ravi
madhan ravi el 23 de Oct. de 2018
Editada: madhan ravi el 23 de Oct. de 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

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by