Index error with no array?

9 ビュー (過去 30 日間)
darkphotonix
darkphotonix 2019 年 5 月 6 日
コメント済み: darkphotonix 2019 年 5 月 6 日
Good afternoon,
I am getting a Index exceeds the number of array elements (1). line 29 which is my fun variable. I am not creating any arrays nor do I have more than one value for a given variable, what is wrong with my code?
L = 7/1000; %1mm/1000mm = 1m
rho = 2800; %kg/m^3
c = 900; %J/kg*K
k = 180; %W/m*K
eff = 0.80;
T_inf = 25 + 273.15; % K
T_surf = T_inf;
As = 0.040;% m^2
q_dp_h = 1.25 * 10^4; %W/m^2*K uniform heat flux
h = 10; %W/m^2*K
T = 135 + 273.15; % K
V = As * L ;
SB = 5.67 * 10^(-8); % W/m^2*K Stephan-Boltzmann
fun = (q_dp_h-(h(T-T_inf))-(eff*SB*((T^4)-(T_surf^4))));
fun2 = ((T-T_inf)*(rho*V*c))/As;
h_r = eff*SB*(T+T_surf)*((T^2)+(T_surf^2));
Bi = (h*L)/k;
Bi_r = (h_r*L)/k;
Bi_tot = Bi+Bi_r;
t=fun2/fun;

採用された回答

Walter Roberson
Walter Roberson 2019 年 5 月 6 日
h(T-T_inf) is a request to index h at location T-T_inf, which just happens to be the integer 110.
Remember that MATLAB does not have any implicit multiplication. All multiplication must be given explicitly using the .* or * operators.
  1 件のコメント
darkphotonix
darkphotonix 2019 年 5 月 6 日
Great! Did not see that mistake!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by