Well, there's the obvious:

N = matrix(0,n-1,n-1)
for(i in 2:(n-1))
     N[1,i] = 1/(pi * (i-1))
for(i in 2:(n-2))
   for(j in i:(n-1))
      N[i,j] = N[i-1,j-1]
for(i in 2:(n-1))
   for(j in 1:i)
      N[i,j] = -N[j,i]

                                        - Phil Spector
                                         Statistical Computing Facility
                                         Department of Statistics
                                         UC Berkeley
                                         spec...@stat.berkeley.edu



Hello,

I'm trying to write the following matlab code into R:

N = zeros(n-1); for i=2:(n-1)

N(1,i) = 1/(pi * (i-1));

end for i=2:(n-2)

for j=i:(n-1) N(i,j) = N(i-1,j-1);

end;

end for i=2:(n-1)

end

for j=1:i N(i,j) = -N(j,i);

end;


any suggestions?


Thanks


can i just add the following line to my calculation N=1/(pi*(i-1)

--
Marcelo Andrade de Lima
UNIFESP - Universidade Federal de S?o Paulo
Departamento de Bioqu?mica
Disciplina de Biologia Molecular
Rua Tr?s de Maio 100, 4 andar - Vila Clementino, 04044-020
Lab +55 11 55764438 R.1188
Cell +55 11 92725274
ml...@unifesp.br

        [[alternative HTML version deleted]]



______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to