Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: vector/matrix manipulation question
Replies: 3   Last Post: Feb 14, 2013 6:37 PM

 Messages: [ Previous | Next ]
 Bruno Luong Posts: 9,668 Registered: 7/26/08
Re: vector/matrix manipulation question
Posted: Feb 14, 2013 3:15 PM

"P" wrote in message <kfjg5p\$mc0\$1@newscl01ah.mathworks.com>...
> Hello,
>
> I'm trying to figure out the simplest Matlab syntax to deal the following 2 scenarios:
>
> 1. let a = [1 2 3; 4 5 6]
>
> what's the cleanest syntax to duplicate each row of a by a factor of x? Let say x = 2, I want to final outcome looking like
>
> b = [1 2 3; 1 2 3; 4 5 6; 4 5 6]

>
>
> 2. Is it possible to transpose an inner dimension of a multi-dimension matrx? Let say
>
> [2 3 4] = size(a)
>
> I want to transpose the latter 2 dimension of a such that
>
> [2 4 3] = size(b)

help permute

Bruno

Date Subject Author
2/14/13 P
2/14/13 Bruno Luong
2/14/13 P
2/14/13 Bruno Luong