Sum values from one column vector based on another column vector
조회 수: 3(최근 30일)
표시 이전 댓글
How do I compute this without using any loops or conditionals?
I want to sum the values in column B based on if the value in column A is a 1
So for example I want to add 34 and 28 only and save it to a new variable
A B
1 34
2 78
4 3
1 28
댓글 수: 0
채택된 답변
추가 답변(0개)
참고 항목
범주
Find more on Loops and Conditional Statements in Help Center and File Exchange
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!