Borrar filtros
Borrar filtros

How to find the mean from multiple plots stored in one matrix?

2 visualizaciones (últimos 30 días)
Hello everyone! My question may be incredibly simple, but I am very new to programming and matlab, so I'd appreciate any help!
I have this cell array that looks like this:
plotting each row with col1 as the x and col2 as the y, this is the plot i get
I need to combine all of these lines to get one line that represents the mean, but Im not sure how to go about approaching the problem.
Any help would be appreciated!

Respuesta aceptada

KSSV
KSSV el 11 de Ag. de 2021
Two options:
  1. Use cell2mat and convert the cell arrays into a matrix and use mean.
  2. Run a loop or use Cellfun and calculate the mean of each cell array and then find the mean of means.
  1 comentario
Sahar Sowdagar
Sahar Sowdagar el 11 de Ag. de 2021
I used the cell2mat and sorted the matrix and managed to get the correct mean! Thank you very much for the suggestion I didn't know about the function until now.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices 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