[R] ciclo for in matrix construction ( matlab - R )

2006-10-04 Thread massimodisasha
hi, i'm new to R i have a little script in matlab now i'm porting it to R but i've some problem. how can i write in R language this matlab/octave code: LX = L ; L is a matrix ss = size(LX,1); E_N_2 = zeros(ss,2); for i = 1:ss E_2 = E_0 + LX(i,1)*C(3)+LX(i,2)*C(4);

[R] ciclo for in matrix construction ( matlab - R )

2006-10-04 Thread massimodisasha
hi, i'm new to R i have a little script in matlab now i'm porting it to R but i've some problem. how can i write in R language this matlab/octave code: LX = L ; L is a matrix ss = size(LX,1); E_N_2 = zeros(ss,2); for i = 1:ss E_2 = E_0 + LX(i,1)*C(3)+LX(i,2)*C(4);

Re: [R] ciclo for in matrix construction ( matlab - R )

2006-10-04 Thread Charles C. Berry
The help page for 'for' warns: Note that it is a common mistake to forget to put braces ('{ .. }') around your statements, e.g., after 'if(..)' or 'for()'. In particular, you should not have a newline between '}' and 'else' to avoid a syntax error in entering a 'if

Re: [R] ciclo for in matrix construction ( matlab - R )

2006-10-04 Thread Jeff Newmiller
massimodisasha wrote: hi, i'm new to R i have a little script in matlab now i'm porting it to R but i've some problem. how can i write in R language this matlab/octave code: LX = L ; L is a matrix ss = size(LX,1); E_N_2 = zeros(ss,2); for i = 1:ss E_2 = E_0