필터 지우기
필터 지우기

Averaging 5 vectors in the top row of a 10x5 cell array.

조회 수: 1 (최근 30일)
Karim ElShorbagi
Karim ElShorbagi 2020년 11월 23일
댓글: Karim ElShorbagi 2020년 11월 23일
In1 is a 10x5 cell array where each cell contains a column vector.
I am trying to take the mean of the 5 vectors in the top row to give me 1 column vector where each element is the average of its corresponding 5 elements.
This is the code I'm trying to use but I get the error: "Expected one output from a curly brace or dot indexing expression, but there were 5 results." any help?
In11 = mean(In1{1,:}(:,1),2);

채택된 답변

David Hill
David Hill 2020년 11월 23일
mean(cell2mat(In1(1:5,:)),2);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by