From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Generate a sphere in a 3d matrix
Date: Wed, 25 May 2011 03:18:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <irhsdb$dfs$>
References: <irhddc$7fc$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1306293483 13820 (25 May 2011 03:18:03 GMT)
NNTP-Posting-Date: Wed, 25 May 2011 03:18:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:728558

"Jacky" wrote in message <irhddc$7fc$>...
> Dear All,
> I am trying to generate sphere in a 100-by-100-by-100 matrix (or 3D matrix). 
> I have been referring to the following thread which is similar to my case but i guess it is different than what i am looking-
> Please help me how to generate a sphere in a N-by-N-by-N matrix.
> Best
> Jacky
- - - - - - - - - -
  Two questions:

1. What is your understanding of a 'sphere' in this context?  Is it a 2D surface of points all equidistant from its center, or is it all points on and inside such a surface?  Your wish for a three-dimensional array would seem to indicate that you are interested in the solid interior of a sphere.

2. What content do you wish your single 3D array to have?  Are the elements to be 'true' or 1 inside the sphere and 'false' or 0 outside?

Roger Stafford