Array indices must be positive integers or logical values.

Why do i have this problem? Array indices must be positive integers or logical values.
Here is my code.
Thanks!

Réponses (2)

Torsten
Torsten le 2 Avr 2023
Modifié(e) : Torsten le 2 Avr 2023
H(0) does not exist in MATLAB. Array indices start with 1.
And if inv(K-W^2*M) is a matrix, you cannot save it in a scalar H(W). You will have to use a cell array:
H{W} = inv(K-W^2*M)

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by