column wise adding
조회 수: 1 (최근 30일)
이전 댓글 표시
i had y= 1 6 4 7 5 3 6 4 9 n so on... i want yout=1+6+4 7+5+3 6+4+9
댓글 수: 0
답변 (1개)
Andrei Bobrov
2011년 6월 8일
doc reshape
doc sum
yout = sum(reshape(y,3,[]));
EDIT
z = sum((x-y).^2,2);
댓글 수: 2
David Young
2011년 6월 8일
y(0) = 1 2 5 does not make sense. First because MATLAB array indexes start from 1; second because if y is a numerical array each element must contain a single value, not 3 values. Please can you clarify what you want to do?
참고 항목
카테고리
Help Center 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!