Index exceeds the number of array elements (1)

1 vue (au cours des 30 derniers jours)
SCIUSCIA
SCIUSCIA le 2 Jan 2021
Commenté : SCIUSCIA le 3 Jan 2021
I am working for writing a script for plotting the spp dispersion. I am modifying an existing .m file.
I have trouble with the following error:
Index exceeds the number of array elements (1).
Error in resonance (line 190)
fsrc1=exp(1i*(kinc(1)*Y+kinc(2)*X));
I wonder if someone can help me to find the uncorrect array .

Réponse acceptée

Jesús Zambrano
Jesús Zambrano le 2 Jan 2021
Hi, please check if kinc indeed has at least two elements, because you are trying to get kinc(1) and kinc(2). Also, check the "1i" inside the exp.
  1 commentaire
SCIUSCIA
SCIUSCIA le 3 Jan 2021
Thank you, indeed kinc allocates one element

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by