taking data from a matrix and summing to a new vector

Im trying to take the values from a matrix, say 8 columns and 40 rows, and take column 3, 4, and 5s data and sum it up for every row and making a vertical vector of these values.

 채택된 답변

Honglei Chen
Honglei Chen 2013년 2월 25일
Here is an example
x = rand(40,8);
sum(x(:,[3 4 5]),2)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2013년 2월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by