A.each(function(value, i) { M[i][2] = value; });
On 8/26/06, Sam <sam.google-Uc2IQQBAS6sAvxtiuMwx3w@public.gmane.org>
wrote:>
>
> What would be a prototype method of copying a vector array
>
> var A = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
>
> into column 2 of a matrix array
>
> var M = [
>
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5],
> [ 7, 6, 5]
> ]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---