Borrar filtros
Borrar filtros

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

4 visualizaciones (últimos 30 días)
Saoirse
Saoirse el 9 de Oct. de 2023
Comentada: Stephen23 el 10 de Oct. de 2023
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)))

Respuestas (1)

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

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by