Info
この質問は閉じられています。 編集または回答するには再度開いてください。
for loop for matrixes
1 回表示 (過去 30 日間)
古いコメントを表示
i have a for loop inside a function and one of the input is a matrix of 44x12 (FC_in) the rest is just a value
i am doing sth work and i am getting error :
Error in Tabelle_43 (line 18)
[ f_pl ] = f_pl_Tabelle_43( T_43, V_H_WS, P_WP_KN, FC_in, FC ) ;
my inputs + function and below the code
T_43 = 1 ;
V_H_WS = 1 ;
FC = 2 ;
[ f_pl ] = f_pl_Tabelle_43( T_43, V_H_WS, P_WP_KN, FC_in, FC ) ;
function [ f_pl ] = f_pl_Tabelle_43( T_43, V_H_WS, P_WP_KN, FC_in, FC )
for i = 1 : 12
for j = 1 : length(FC_in)
if T_43 == 1
% Kleinflaeche Waermeabgabe V_H_WS = 0
if V_H_WS == 0 && FC_in(j,i) < 0.5 && FC_in(j,i) > 0
f_pl(j,i) = 0.588 ;
elseif V_H_WS == 0 && FC_in(j,i) >= 0.5 && FC_in(j,i) < 1
f_pl(j,i) = 0.588+0.822.*(FC-0.5) ;
% Kleinflaeche Waermeabgabe 0 < V_H_WS < 30*P_WP_KN
elseif V_H_WS > 0 && V_H_WS < 30*P_WP_KN && FC_in(j,i) < 0.5 && FC_in(j,i) > 0
f_pl(j,i) = 0.588+0.01*(V_H_WS./P_WP_KN) ;
elseif V_H_WS > 0 && V_H_WS < 30*P_WP_KN && FC_in(j,i) >= 0.5 && FC_in(j,i) < 1
f_pl(j,i) = 0.177+0.02*(V_H_WS./P_WP_KN)-0.02*FC ;
% Kleinflaeche Waermeabgabe V_H_WS >= 30*P_WP_KN
elseif V_H_WS >= 30*P_WP_KN && FC_in(j,i) < 0.5 && FC_in(j,i) > 0
f_pl(j,i) = 0.888 ;
elseif V_H_WS >= 30*P_WP_KN && FC_in(j,i) >= 0.5 && FC_in(j,i) < 1
f_pl(j,i) = 0.888+0.222*(FC-0.5) ;
else
error('error !')
end
elseif T_43 == 2
% Grossflaechige Waermeabgabe
if FC_in(j,i) < 0.5 && FC_in(j,i) > 0
f_pl(j,i) = 0.974;
elseif FC_in(j,i) >= 0.5 && FC_in(j,i) < 1
f_pl(j,i) = 0.974+0.05.*(FC-0.5);
else
error('error !')
end
else
error('error !')
end
end
end
end
3 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!