필터 지우기
필터 지우기

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

조회 수: 3 (최근 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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by