How to get sum of columns even if the matrix is a row vector?

I'd like to get the sum of columns in a matrix, but when the matrix has only one row, the SUM function gives the sum of all elements in the row. How can I skip that? The ideal solution will return the row vector itself.

 채택된 답변

추가 답변 (0개)

카테고리

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

질문:

2016년 10월 4일

편집:

2016년 10월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by