When i saved my code , I am getting this error "Undefined function 'X0' for input arguments of type 'double'". Why is that?

1 次查看(过去 30 天)
Tb0 =100;
Tvc =110;
% initialisation du débit de la vapeur de chauffage (Mvc) en [kg/s]
x0(5*n+1)=((Uh*Ah)/Ls)*((Tb0-x0(4*n))/log((Tvc-x0(4*n))/(Tvc-Tb0)));

采纳的回答

michio
michio 2016-10-4
x0 in your code is a variable or a function? The error message says that x0 is not defined.
  3 个评论
michio
michio 2016-10-4
编辑:michio 2016-10-4
Hm, no clue at the moment. Could you provide a sample code that I can actually run in my end and that reproduces the same error?
It would be much easier to help you here.
ahlem sellami
ahlem sellami 2016-10-5
编辑:Jan 2016-10-5
fprintf('* Données de l installation \n');
fprintf('--------------------------- \n');
n=input(' Nombre des étages: n =21 ');
Tb0=input('Température maximale de chauffage de la saumure, [°C]:T0 =100');
Tvc=input('Température de la vapeur de chauffage en [°C]: Ts =110');
% initialisation des inconnues du système d'équations
%initialisation de la température de l'eau à la sortie des condenseurs
% (ti) en [°C]
for i=1:n
x0(4*n+i-1)=Tf+((n+1)-i)*dT1;
end
% initialisation du débit de la vapeur de chauffage (Mvc)
% en [kg/s]
x0(5*n+1)=((Uh*Ah)/Ls)*((Tb0-x0(4*n))/log((Tvc-x0(4*n))/(Tvc-Tb0)));
% initialisation du débit de l'eau d'alimentation (Mf) en [kg/s]
x0(5*n)=(Ls/Cph)*(x0(5*n+1)/(Tb0-x0(4*n)));
Uh, Ah and Ls are data it
Error
Undefined function 'x0' for input arguments of type 'double'.
Error in
x0(5*n+1)=((Uh*Ah)/Ls)*((Tb0-x0(4*n))/log((Tvc-x0(4*n))/(Tvc-Tb0)));

请先登录,再进行评论。

更多回答(1 个)

Jan
Jan 2016-10-5
What is "Tf" and "dT1"? Did you notice that in the header of your question the name is "X0" with an uppercase X?

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by