How to calculate mean across the elements of a cell?

조회 수: 4 (최근 30일)
Tomaszzz
Tomaszzz 2022년 2월 21일
댓글: Jan 2022년 2월 22일
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?

채택된 답변

Jan
Jan 2022년 2월 21일
편집: Jan 2022년 2월 21일
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
Tomaszzz
Tomaszzz 2022년 2월 22일
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 2022년 2월 22일
Okay. Thanks for the explanation.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by