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

1 回表示 (過去 30 日間)
Rigo ZOO
Rigo ZOO 2022 年 8 月 25 日
コメント済み: Rigo ZOO 2022 年 8 月 25 日
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 件のコメント
Rigo ZOO
Rigo ZOO 2022 年 8 月 25 日
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 2022 年 8 月 25 日
We do not have your input files, and we do not know what parameters you are calling the function with.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 25 日
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 件のコメント
Rigo ZOO
Rigo ZOO 2022 年 8 月 25 日
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 2022 年 8 月 25 日
Hi Walter,
Great, thanks again, it works and I understood the notion about the scalar definition and the number of iteration
Regards,
Rigo

サインインしてコメントする。

その他の回答 (1 件)

Rigo ZOO
Rigo ZOO 2022 年 8 月 25 日
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

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by