Hello, I am working on a project which needs matlab. I am new to matlab and have only basic information. Now I have found a paper which included a matlab code. I am trying to understand it. So when I type the code and run the simulation matlab gives me this error: "Attempted to access Tg_in(2); index out of bounds because numel(Tg_in)=1."

The for loop for this code is:

`for m=1:NN %MM`

rho_g(m)=354.6E0/Tg_in(m); %density(Tg_in) [kg/m^3]

Mass_input(m)=SV_in(m)/3600.0E0*Vo1ume*rho_g_STP; %Tota1 mass input [Kg/s]

mass_input_cell(m)=Mass_input(m)/num_cell; %Mass f1ow rate per cell [Kg/s]

q_input_cell(m)=mass_input_cell(m)/rho_g(m); %f1ow rate per cell [m^3/s]

u_in(m)=q_input_cell(m)/Ag; %f1ow ve1ocity [m/s]

Cair_in(m)=rho_g(m)/MOLEMASS_AIR*1.0E3;Cnh3_in(m)=Cair_in(m)*Xnh3_in(m);Cno_in(m)=Cair_in(m)*Xno_in(m);Co2_in(m)=Cair_in(m)*0.08;end

I have put NN=1000;

Can you guys help me to understand what is wrong in it?

## Best Answer