필터 지우기
필터 지우기

Why is max(abs(S)) not working? S is a 1x40000 vector

조회 수: 4 (최근 30일)
Saoirse
Saoirse 2023년 10월 9일
댓글: Stephen23 2023년 10월 10일
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)))

답변 (1개)

Walter Roberson
Walter Roberson 2023년 10월 9일
Either max or abs is a variable at that point in the code.
  댓글 수: 3
Walter Roberson
Walter Roberson 2023년 10월 10일
In my observation, the two functions most commonly accidentally re-used as variable names are sum and max
Stephen23
Stephen23 2023년 10월 10일
Solution: rename those variables where they are created/referred to, clear the workspace, run your code again.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by