> I just started to learn some python today for first time,
> so be easy on me.
> I am having some trouble figuring how do the problem shown in this link
> http://12000.org/my_notes/mma_matlab_control/KERNEL/KEse44.htm >
> Given 4 column vectors, v1,v2,v3,v4, each is 3 rows.
> I want to use these to construct matrix mat, which is
> So the resulting matrix is as shown in the link. i.e.
> it will be 6 rows and 2 columns.
> This is what I tried:
> import numpy as np
> And now I get stuck, I tried
> m=np.array([[v1,v2],[v3,v4]]) #no good
> Out: (4L, 3L)
> array([[ 1, 4, 7, 10],
> [ 2, 5, 8, 11],
> [ 3, 6, 9, 12]])
> Not what I want.
> I need to get the shape as in the above link, 6 rows by 2 columns,
> where each column vector is stacked as shown. I also tried
> v1=np.array([1,2,3]); v1.shape=3,1
> v2=np.array([4,5,6]); v2.shape=3,1
> v3=np.array([7,8,9]); v3.shape=3,1
> v4=np.array([10,11,12]); v4.shape=3,1
> What is the correct way to do this in Python?
And since he seems to want a Matlab-like environment, then the somewhat
depreciated pylab was intended to dump a Matlab-like set of functions
into the namespace, which is OK for an interactive environment, an not
too much of a problem for a short program in a single module. Probably
best to do that with iPython, though.
On Sunday, 21 June 2015 20:43:15 UTC+5:30, Dennis Lee Bieber wrote:
> On Sun, 21 Jun 2015 09:32:55 +0100, Mark Lawrence declaimed the following:
> >On 21/06/2015 04:47, Nasser M. Abbasi wrote:
> >> But it is not as intuitive as with Matlab
> >For those of us who don't know would you be kind enough to do a cost
> >comparison of Matlab vs Python licenses?
> Or even Matlab vs Octave
Well if its a parentheses minimization contest, APL will beat the pants of everything.