Re: Special Matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg28233] Re: [mg28217] Special Matrix
- From: Mianlai Zhou <lailai at carmen.nikhef.nl>
- Date: Fri, 6 Apr 2001 01:52:44 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Hello, I think the following line is a very short also quite elegant way
to realize it:
Table[ UnitStep[i-2, j-2, n-i-1, n-j-1], {i, n}, {j, n} ]
Good Luck!
On Thu, 5 Apr 2001, Yoram Pollack wrote:
> Hello
> I am trying to create a "n x n" matrix with "1" in every position exept in
> first and last row, and first and last coulumn, where "0" is needed. In
> other words: sqare matrix full of "1" sorounded by "0".
> What will be the fastest and shortest way to do it?
>
> Thanks
> Yoram
>
>
>