Why is max(abs(S)) not working? S is a 1x40000 vector
4 ビュー (過去 30 日間)
古いコメントを表示
S is a 1x40000 vector with negative values hence why im using the abs function but the error message keeps coming up. I have also tried max((abs(S(1,:))) but it has the same error message
"Array indices must be positive integers or logical values.
Error in Max (line 5)
max((abs(S)))"
load 'testhigh (1).dat'
S = (testhigh__1_(1, :)*10^3)*(1/49.500);
max((abs(S)))
0 件のコメント
回答 (1 件)
Walter Roberson
2023 年 10 月 9 日
Either max or abs is a variable at that point in the code.
3 件のコメント
Walter Roberson
2023 年 10 月 10 日
In my observation, the two functions most commonly accidentally re-used as variable names are sum and max
Stephen23
2023 年 10 月 10 日
Solution: rename those variables where they are created/referred to, clear the workspace, run your code again.
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!