フィルターのクリア

Error using sum function

18 ビュー (過去 30 日間)
Nour Aburaed
Nour Aburaed 2018 年 12 月 26 日
編集済み: Bruno Luong 2023 年 11 月 25 日
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 件のコメント
DGM
DGM 2023 年 11 月 25 日
Ah.
Paul
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
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
madhan ravi 2018 年 12 月 26 日
But sir Image Analyst I’m using student version too , it works in my case though.
Steven Lord
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 ExchangeResizing and Reshaping Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by