Path: news.mathworks.com!not-for-mail
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$1@newscl01ah.mathworks.com>
References: <irhddc$7fc$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1306293483 13820 172.30.248.45 (25 May 2011 03:18:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 May 2011 03:18:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:728558

"Jacky" wrote in message <irhddc$7fc$1@newscl01ah.mathworks.com>...
> 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-
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/297108
> 
> 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