Matrix construction.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Matrix construction.

K D Kavu
I'd been trying to construct a 3*100 matrix with elements 1-300 (i.e 1 2 ... ... 100
             101 ... ... 200
             201 ... ... 300
The program is returning this error: number of columns must match (101 !=100).
I wonder how this have happened since I rechecked the inputs.

Duncan
Sent from my BlackBerry® wireless device
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Duncan
Reply | Threaded
Open this post in threaded view
|

Re: Matrix construction.

Doug Stewart-4


On Sun, Aug 12, 2012 at 5:10 AM, <[hidden email]> wrote:
I'd been trying to construct a 3*100 matrix with elements 1-300 (i.e 1 2 ... ... 100
             101 ... ... 200
             201 ... ... 300
The program is returning this error: number of columns must match (101 !=100).
I wonder how this have happened since I rechecked the inputs.

Duncan
Sent from my BlackBerry® wireless device
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave

 a=[1:10;11:20;21:30]


--
DAS

https://linuxcounter.net/user/206392.html

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Matrix construction.

Alasdair McAndrew
In reply to this post by K D Kavu
How about:

transpose(reshape(1:300,100,3))

-Alasdair

On Sun, Aug 12, 2012 at 7:10 PM, <[hidden email]> wrote:
I'd been trying to construct a 3*100 matrix with elements 1-300 (i.e 1 2 ... ... 100
             101 ... ... 200
             201 ... ... 300
The program is returning this error: number of columns must match (101 !=100).
I wonder how this have happened since I rechecked the inputs.

Duncan
Sent from my BlackBerry® wireless device
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave



--
Blog: http://amca01.wordpress.com
Web:  http://sites.google.com/site/amca01/
Facebook: http://www.facebook.com/alasdair.mcandrew

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave