[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing the Dimension of a Matrix
From: |
Andy Buckle |
Subject: |
Re: Changing the Dimension of a Matrix |
Date: |
Mon, 13 Sep 2010 06:30:43 +0100 |
> Please forgive my ignorance. But is there a built-in command in Octave
> that changes the dimension of a matrix? For instance, say
> A = [1, 2, 3, 4, 5, 6].
> Is there a command to transform A into a matrix B with two rows and
> three columns directly instead of doing the following?
> B(1,:)=A(1:3);
> B(2,:)=A(4:6);
> Thank you very much!
> Sincerely,
> Kwa
> reshape(A,2,3)
ans =
1 3 5
2 4 6
--
/* andy buckle */