Re: Matrix Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg53589] Re: Matrix Problem
- From: Bill Rowe <readnewsciv at earthlink.net>
- Date: Wed, 19 Jan 2005 01:59:50 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On 1/18/05 at 5:07 AM, nilaakash at gmail.com (nilaakash) wrote:
>I face a problem to get (3xn) matrix data. Here I am giving a
>simple example.
>data = Table[{Sin[x], Cos[y], Sin[x] Cos[y]}, {x, 0, 3, 1},
>{y, 0, 2, 1}];
>MatrixForm[data]
>It prints a (4x3) block matrix.
It should be a 4x3x3 matrix. So I assume you mis-typed here
>Could anybody tell me how shall I get only 3 column matrix like
>following matrix ?
Flatten[data,1] will create what you want. But note Sin[0] gets evaluated to 0 and Cos[0] gets evaluated to 1. So rather than having the first row as you indicated in your post it will be {0,1,0}.
If you really want to have the output be Sin[0] rather than 0, there is probably a way to do this using Hold.
--
To reply via email subtract one hundred and four