Index exceeds matrix dimensions
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, I noticed that Matlab was returning the error "Index exceeds matrix dimensions" when running this default script:
%%Sum of Vector Elements
% Create a vector and compute the sum of its elements.
% Copyright 2015 The MathWorks, Inc.
A = 1:10;
S = sum(A);
How can I fix that? Thanks in advance!
採用された回答
Star Strider
2016 年 10 月 22 日
In your Command Window, type:
which sum -all
If the first on the list of results is:
sum is a variable.
you have your answer.
The ‘fix’ is to rename your ‘sum’ variable to something else that makes sends in the context of your code, for example ‘sum_v’.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!