How to calculate mean across the elements of a cell?

1 visualización (últimos 30 días)
Tomaszzz
Tomaszzz el 21 de Feb. de 2022
Comentada: Jan el 22 de Feb. de 2022
I have a 7 x 1 cell(attached) with elements in the following dimensions
I want to calcuate the mean across seven rows so my output will be one row of dimension 100x1. Can you help please?

Respuesta aceptada

Jan
Jan el 21 de Feb. de 2022
Editada: Jan el 21 de Feb. de 2022
Cells are a really bad way to store data, if you want to perform calculations with them. Simply convert them to a numerical array:
data = cat(2, YourCell{:});
result = mean(data, 2); % Now it's easy
  4 comentarios
Tomaszzz
Tomaszzz el 22 de Feb. de 2022
Hi Jan. Yes, I deleted it. I typed 'filter' instead of 'filtfilt' and changing it solved the issue. What you say, is the second mistake I realized there was. Apologies for deleting the question too early.
Jan
Jan el 22 de Feb. de 2022
Okay. Thanks for the explanation.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Mobile Fundamentals 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