[ADMB Users] fill matrix with a vector

Richard Chandler richard.chandlers at gmail.com
Thu Mar 24 09:23:45 PDT 2011


Hi,

Is it possible to fill an entire matrix with a vector, without looping, as
can be done in R:

m <- matrix(NA, 3, 3)
m[] <- 1:9

I have seen section 15.10 of the manual, but those methods seem to be
designed for filling individual rows or columns of a matrix. I tried this:

mu = X * beta;
mu_mat = mu;

but it unsurprisingly did not work.

Thanks,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110324/c6b59db2/attachment.html>


More information about the Users mailing list