How do calculate the summation of every row in the given table?

조회 수: 90 (최근 30일)
ahmed obaid
ahmed obaid 2017년 8월 19일
답변: KL 2017년 8월 19일
Dear Experiences
i have a table that look like the following:
Table:
Name RC BV CC RQ CY ..... TY
A1 1 0 1 0 1 0
A2 1 0 0 0 0 0
A3 0 1 1 0 1 0
A4 0 0 0 0 0 1
then the Result of applying such operation look like the following:
Name RC BV CC RQ CY ..... TY Sum
A1 1 0 1 0 1 0 2
A2 1 0 0 0 0 0 1
A3 0 1 1 0 1 0 3
A4 0 0 0 0 0 1 1
where the Sum column involve the summation of every independent row,
thanks for any help.

채택된 답변

KL
KL 2017년 8월 19일
yourTable.Sum = sum(yourTable{:,2:end},2);

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by