Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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 comentarios
Rigo ZOO
Rigo ZOO el 25 de Ag. de 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 el 25 de Ag. de 2022
We do not have your input files, and we do not know what parameters you are calling the function with.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Ag. de 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 comentarios
Rigo ZOO
Rigo ZOO el 25 de Ag. de 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 el 25 de Ag. de 2022
Hi Walter,
Great, thanks again, it works and I understood the notion about the scalar definition and the number of iteration
Regards,
Rigo

Iniciar sesión para comentar.

Más respuestas (1)

Rigo ZOO
Rigo ZOO el 25 de Ag. de 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

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by