필터 지우기
필터 지우기

how to find the difference between first column and second column in a cell array

조회 수: 2 (최근 30일)
I am a having cell
C=5x1 cell
which contains
10x2 double
10x2 double
10x2 double
10x2 double
10x2 double
I need to find the difference between first and second column of C. Could anyone please help me on it.

채택된 답변

Simon Chan
Simon Chan 2021년 7월 18일
cellfun(@(x) x(:,1)-x(:,2),C,'UniformOutput',false)
  댓글 수: 5
jaah navi
jaah navi 2021년 7월 18일
I used the command
D=cellfun(@(x) sum((x(:,1)-x(:,2)).^2)/10,C,'UniformOutput',false)
Now I want to sum D and divide by 5.
Could you please help me on this.

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by