MATLAB: Can anybody help on this FOR loops

for loopstructural dynamics

I do not really understand what exactly is wrong here.
I want to have the following variables give seperate results for each n.
Can you help me correct this?
for n = 1:N
Ln(n)=V(1:N,n)'*M*l
Mn(n)=V(1:N,n)'*M*V(1:N,n)
Gamma_n(n)=Ln/Mn
Mn_star(n)=Ln^2/Mn
fn_st(n)=Gamma_n.*M*V(1:N,n)
end

Best Answer

[Ln, Mn, Gamma_n, Mn_star, fn_st] = zeros(N,1);
for n = 1:N
Ln(n)=V(1:N,n)'*M*l;
Mn(n)=V(1:N,n)'*M*V(1:N,n);
Gamma_n(n)=Ln(n)/Mn;
Mn_star(n)=Ln(n)^2/Mn;
fn_st(n)=Gamma_n(n).*M*V(1:N,n);
end