MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > Matlab procedure equivalent to 'table" command in ... 

Subject: Matlab procedure equivalent to 'table" command in Mathematica for creating arrays From: Franz Date: 18 Mar, 2013 18:40:12 Message: 1 of 8 
I was wondering whether there is any procedure equivalent for the 'Table' command in Mathematica for creating multidimensional arrays (tensors) from given vectors/arrays? 
Subject: Matlab procedure equivalent to 'table" command in Mathematica for creating arrays From: Franz Date: 18 Mar, 2013 19:19:10 Message: 2 of 8 
I have just thought of the following procedure myself, although I believe that there must be something more elegant than this for a general case: 
Subject: Matlab procedure equivalent to 'table" command in Mathematica for creating arrays From: Josh Meyer Date: 18 Mar, 2013 19:41:47 Message: 3 of 8 
slightly better with only one loop: 
Subject: Matlab procedure equivalent to 'table" command in Mathematica for creating arrays From: Josh Meyer Date: 18 Mar, 2013 20:03:21 Message: 4 of 8 
Silly me, bsxfun has singleton expansion enabled already! This is what 
Subject: Matlab procedure equivalent to 'table" command in Mathematica From: Nasser M. Abbasi Date: 19 Mar, 2013 02:21:16 Message: 5 of 8 
On 3/18/2013 2:03 PM, Josh Meyer wrote: 
Subject: Matlab procedure equivalent to 'table" command in Mathematica for creating arrays From: Franz Date: 19 Mar, 2013 08:36:15 Message: 6 of 8 
Thanks, bsxfun in this case does the job. Nevertheless, I think it is still very restrictive in what functions you can use with it, and also generalisations to higher dimensions (say creating a m X n X p array out of a m X n matrix and a vector with dimension p) seem generally not possible. But thanks for the help! 
Subject: Matlab procedure equivalent to 'table" command in Mathematica for creating arrays From: Duncan Po Date: 19 Mar, 2013 12:37:07 Message: 7 of 8 
bsxfun works for higher dimensions. It can operate on a m X n matrix and a 1 X 1 X p vector to generate a m X n X p array. 
Subject: Matlab procedure equivalent to 'table" command in Mathematica for creating arrays From: Steven_Lord Date: 19 Mar, 2013 13:45:53 Message: 8 of 8 

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.