• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Stretching a vector

juanito

Member
Hi -


I have a vector that I'm feeding into a chart. Let's say it's {1,3,4}. Because of the way the chart's set up I need to transform the vector into {1,0,0,3,0,0,4,0,0} - so I'm inserting two zero values between each vector element.


Any ideas how to do this?


Thanks, Juanito
 
Hi Juanito ,


You can do this with the matrix multiplication function MMULT.


The following vector : {1,3,4} has 1 row and 3 columns ; the vector that you want {1,0,0,3,0,0,4,0,0} has 1 row and 9 columns.


To get a 1 x 9 vector from a 1 x 3 vector , multiply the 1 x 3 vector by a 3 x 9 matrix :


=MMULT({1,3,4},{1,0,0,0,0,0,0,0,0;0,0,0,1,0,0,0,0,0;0,0,0,0,0,0,1,0,0})


will give you the 1 x 9 vector.


Narayan
 
Back
Top