<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/320904</link>
    <title>MATLAB Central Newsreader - sphere coordinates</title>
    <description>Feed for thread: sphere coordinates</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.de/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sun, 10 Jun 2012 20:14:07 +0000</pubDate>
      <title>sphere coordinates</title>
      <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/320904#879633</link>
      <author>Jart </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I'm trying to get a matrix that includes the coordinates that are in a sphere. These coordinates are chosen random. This is the script now:&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
R=2&lt;br&gt;
N=10&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
c=(4*rand(3,N))-2&lt;br&gt;
&lt;br&gt;
for i=1:N&lt;br&gt;
A(i)=sum((c(:,i)).^(2));  &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if A(i)&amp;gt;R^(2)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c(:,i)=[];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
The idea is that i create a 3 by N matrix with coordinates that are in a 4x4 box with. When the coordinates are squared and added they should not be bigger than 2^2=4. When it is bigger than 4 the column should be erased out of the random matrix c.&lt;br&gt;
&lt;br&gt;
But it doesn't work. Does anybody know how I have to do this</description>
    </item>
  </channel>
</rss>
