I have this error Index in position 1 exceeds array bounds.

2 vues (au cours des 30 derniers jours)
Rigo ZOO
Rigo ZOO le 25 Août 2022
Commenté : Rigo ZOO le 25 Août 2022
I have a script, when I run it, I have the eabove error:
Index in position 1 exceeds array bounds.
Error in BEM (line 245)
angle=foilarray{airfoil,1}(aoacounter,1);
(Line 245 is this one) ----> angle=foilarray{airfoil,1}(aoacounter,1);
I read solution regarding this topic but no answer was helpful
  6 commentaires
Rigo ZOO
Rigo ZOO le 25 Août 2022
Hi Walter,
I have attached the script to this mail, please can you have a look, I don't understand why foilarray{3,1} is empty
Regards,
Rigo
Walter Roberson
Walter Roberson le 25 Août 2022
We do not have your input files, and we do not know what parameters you are calling the function with.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 25 Août 2022
Every one of your .dat files have text headers on them, but in every case you are using textscan() with %f format and no Headerlines
For those files, you should be using
'HeaderLines', 53
  4 commentaires
Rigo ZOO
Rigo ZOO le 25 Août 2022
I have removed this line
U=8; % Added by RIGO. U is already define as input of this function.
Sorry, this statment is not clear: with U being a scalar, n will be 1, so for i=1:n is only going to do one iteration.
Thanks the disp() shows both values: Thrust and Torque
Rigo ZOO
Rigo ZOO le 25 Août 2022
Hi Walter,
Great, thanks again, it works and I understood the notion about the scalar definition and the number of iteration
Regards,
Rigo

Connectez-vous pour commenter.

Plus de réponses (1)

Rigo ZOO
Rigo ZOO le 25 Août 2022
Sorry, but the dat file are unsupported on Matlab forum. I changed the file extension to txt, just change back to dat file before use in this script.
U = 8m/s
Time = 100s
B = 3
Omega = 1.0159
rho = 1.25
maxdev = 0.00001
Regards,
Rigo

Catégories

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

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by