"Raghavasimhan Thirunarayanan" <kingmakerbull@rediffmail.com> wrote in message <go334l$8fh$1@fred.mathworks.com>...
> Hello,
> I want to know whether in matlab, a matrix that is got from the user can be rotated....
> For example if my input matrix is
> 1 2 3 0
> 4 5 6 0
> 7 8 9 0....
> my desired matrix is
> 1 2 3 0 4 5 6 0 7 8 9 0
> 4 5 6 0 7 8 9 0 1 2 3 0
> 7 8 9 0 1 2 3 0 4 5 6 0
> In other words if my input matrix is
> A
> B
> C
> D...
> I want a new matrix constructed looking like this,
> A B C D
> B C D A
> C D A B
> D A B C
>
> I want this done for matrices of any order....
> Is it possible...If so kindly help me out in this...
> Thanks in advance
>
I do not understand what you want at all. In your first example you ask for a rotation of an input matrix, but then the desired matrix has three times the number of columns of your input matrix? And even if I try to understand this, why don't you rotate the column of zeros?
I think that "in other words" should read: "Here is a second, unrelated question" ... and what do you mean by "matrices of any order".
Rephrase your problem giving better examples! Or "in other words", type "why" at the command prompt, or use Bruno's solution "hankel" ;)
Jos
