If statement parse error


I am getting constant parse error in my code and have no idea what am I missing.
Can you look on it please?

error: parse error near line 250 of file [\ path] syntax error >>>> else

The code:

for i=1:1000


if (i==1)
            [p_e(i)]        = p_0;
            [p_c(i)]        = p_0;
            [dm(i)]         = 0;
            [m_e(i)         = (V_e(1)*p_0)/(R*T_room);
            [m_c(i)         = (V_c(1)*p_0)/(R*T_room);
            [T_e(i)]        = T_room;
            [T_c(i)]        = T_room;        
else %(row250)
            [p_e(i)]        = nthargout(1,@pressure,i,m_e,m_c,R,T_e,T_c,V_e,V_c);
            [p_c(i)]        = nthargout(2,@pressure,i,m_e,m_c,R,T_e,T_c,V_e,V_c);
            [dm(i)]         = nthargout(1,@anyagmennyisegvaltozas,i,rho,mu,p_e,p_c,l_d,r_1,r_2,v_d);    
            [m_e(i)]        = nthargout(1,@anyagmennyiseg,i,V_e,V_c,p_e,p_c,T_e,T_c,dm);
            [m_c(i)]        = nthargout(2,@anyagmennyiseg,i,V_e,V_c,p_e,p_c,T_e,T_c,dm);
            [T_e(i)]        = nthargout(1,@temperature,i,m_e,m_c,C_v,R_t1,T_e,T_H,T_C,p_e,p_c,V_e,V_c,dm,T_room);
            [T_c(i)]        = nthargout(2,@temperature,i,m_e,m_c,C_v,R_t1,T_e,T_H,T_C,p_e,p_c,V_e,V_c,dm,T_room);



In case I comment out the if statement then the error occurs with the endfor and if I comment out the for statetment too the parse error will refer to the last line of the code which is empty.

There are more functions in the not copied part of the code, including if statements. I have checked them and everyone is closed with end.

My system

  • 64bit Windows 10 Pro 20H2 19042.1288
  • x86_64-w64-mingw32
  • Graphics card: nVidia Quadro M1000M
  • Octave version: 6.1.0
  • Installation method: Downloaded and installed “octave-6.1.0-w64-installer.exe” from Download

Any help would be appreciated. Thank you in advance.


I got it, brackets are missing:
[m_e(i) = (V_e(1) p_0)/(R T_room);
[m_c(i) = (V_c(1) p_0)/(R T_room);

[m_e(i)] = (V_e(1) p_0)/(R T_room);
[m_c(i)]= (V_c(1) p_0)/(R T_room);