Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1598 > unrolled thread

concatenate matrices?

Started byhadi motamedi <motamedi24@gmail.com>
First post2011-04-11 11:08 +0000
Last post2011-04-12 09:58 +0000
Articles 4 — 4 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  concatenate matrices? hadi motamedi <motamedi24@gmail.com> - 2011-04-11 11:08 +0000
    Re: concatenate matrices? "Nasser M. Abbasi" <nma@12000.org> - 2011-04-12 09:56 +0000
    Re: concatenate matrices? David Bailey <dave@removedbailey.co.uk> - 2011-04-12 09:57 +0000
    Re: concatenate matrices? Peter <petsie@dordos.net> - 2011-04-12 09:58 +0000

#1598 — concatenate matrices?

Fromhadi motamedi <motamedi24@gmail.com>
Date2011-04-11 11:08 +0000
Subjectconcatenate matrices?
Message-ID<inunen$2g1$1@smc.vnet.net>
Dear All
I have two column matrices named y1 & y2 with dimensions as 448000*1 .
Can you please let me know how to construct a new matrix say 'y' with
dimensions 448000*2 such that each column of it equals y1(or y2)?
Thank you

[toc] | [next] | [standalone]


#1626

From"Nasser M. Abbasi" <nma@12000.org>
Date2011-04-12 09:56 +0000
Message-ID<io17l3$i9o$1@smc.vnet.net>
In reply to#1598
On 4/11/2011 4:08 AM, hadi motamedi wrote:
> Dear All
> I have two column matrices named y1&  y2 with dimensions as 448000*1 .
> Can you please let me know how to construct a new matrix say 'y' with
> dimensions 448000*2 such that each column of it equals y1(or y2)?
> Thank you
>

y1 = {1,2,3}
y2 = {4,5,6}
y  = Transpose@{y1,y2}

--Nasser

[toc] | [prev] | [next] | [standalone]


#1632

FromDavid Bailey <dave@removedbailey.co.uk>
Date2011-04-12 09:57 +0000
Message-ID<io17n3$ibf$1@smc.vnet.net>
In reply to#1598
On 11/04/2011 12:08, hadi motamedi wrote:
> Dear All
> I have two column matrices named y1&  y2 with dimensions as 448000*1 .
> Can you please let me know how to construct a new matrix say 'y' with
> dimensions 448000*2 such that each column of it equals y1(or y2)?
> Thank you
>

I will assume that by 'column matrix', you mean a vector. In that case 
you should use

Transpose[{y1,y2}]

Note that in general it is almost always better to frame your questions 
with some code because it eliminates all sorts of possible ambiguities.

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#1634

FromPeter <petsie@dordos.net>
Date2011-04-12 09:58 +0000
Message-ID<io17np$ic0$1@smc.vnet.net>
In reply to#1598
Am 11.04.2011 13:08, schrieb hadi motamedi:
> Dear All
> I have two column matrices named y1&  y2 with dimensions as 448000*1 .
> Can you please let me know how to construct a new matrix say 'y' with
> dimensions 448000*2 such that each column of it equals y1(or y2)?
> Thank you
>

use Transpose:

In[4]:= {y1,y2}=Partition[Range[0,9],5];
MatrixForm[result=Transpose[{y1,y2}]]
Out[5]//MatrixForm=
  0	5
  1	6
  2	7
  3	8
  4	9


[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web