Error using sum function
조회 수: 7 (최근 30일)
이전 댓글 표시
I have a 26x26 matrix 'A' of type double. I want to sum all of its elements using S = sum(A, 'all').
I keep getting the following error:
Error using sum
Invalid option. Option must be 'double', 'native', 'default', 'omitnan' or 'includenan'.
Can someone help me with this? My matrix is of the correct type, so I am not sure what's wrong.
댓글 수: 12
Paul
2023년 11월 25일
편집: Bruno Luong
2023년 11월 25일
I assume sum(X,'all') is implemented as sum(X(:)) at the intermediate interface level before the sum hoerachy and low-level CPU instruction occurs, so I think yes, they should return the same result.
채택된 답변
madhan ravi
2018년 12월 26일
편집: madhan ravi
2018년 12월 26일
sum(A(:)) % if it doesn't work either upload your matrix as .mat file
댓글 수: 9
madhan ravi
2018년 12월 26일
But sir Image Analyst I’m using student version too , it works in my case though.
Steven Lord
2018년 12월 26일
Image Analyst: clicking on the "Buy MATLAB and Simulink Student Suite" button on this page brings up the store page for the Student Version of release R2018b.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!