title: How to optimize norm calculation in Matlab?
body: <p>I had like to optimize the following Matlab code :</p>
  
  <blockquote>
    <p>x = linspace(-5,5,100);<br>
    y = linspace(-5,5,100);<br>
    z = linspace(-5,5,100);<br>
    [xp,yp,zp] = meshgrid(x,y,z);</p>
    
    <p>norm = sqrt(xp.^2+yp.^2+zp.^2);</p>
  </blockquote>
  
  <p>I improved it a little using realsqrt :</p>
  
  <p>norm_0 = sqrt(xp.^2+yp.^2+zp.^2)       10.106 s   37.0%<br>
  norm_1 = realsqrt(xp.^2+yp.^2+zp.^2)   10.100 s   35.0%</p>
  
  <p>Any other ideas ?</p>