Skip to content
Prev 293718 / 398513 Next

Translation of matlab vectors code into r

Haio <joakim.aback <at> gmail.com> writes:
This is extremely bad Matlab code, I would discourage you to translate it 
line by line. What the code does:

It takes each of the matrices n_o, n_s, n_n, nanst_o, nanst_s, nanst_n 
and combines the first five lines into vectors each. A way to do this in R 
could be as follows:

    tempo <- c(t(n_o[1:5, ]))
    # etc.

where n_o, etc. will be the same matrices as in your Matlab example.
A similar solution, of course, would be possible in Matlab.