<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Compare these two different things<br>
      <br>
      This<br>
      ---------------------------<br>
      x=[0:0.1:2*%pi]'; <br>
      x($), sin(x($)), sin(2*%pi)<br>
      ans  =<br>
       <br>
          6.2  <br>
       ans  =<br>
       <br>
        - 0.0830894  <br>
       ans  =<br>
       <br>
        - 2.449D-16 <br>
      ----------------------------<br>
      and this<br>
      ---------------------------<br>
      x=linspace(0,2*%pi)';<br>
      x($), sin(x($)), sin(2*%pi)<br>
      ans  =<br>
       <br>
          6.2831853  <br>
       ans  =<br>
       <br>
        - 2.449D-16  <br>
       ans  =<br>
       <br>
        - 2.449D-16 <br>
      ----------------------------<br>
      $ will give you the index of the last vector element.<br>
      Have in mind that colon operator and linspace() work differently.
      <br>
      <br>
      -->0:0.1:0.99<br>
       ans  =<br>
       <br>
          0.    0.1    0.2    0.3    0.4    0.5    0.6    0.7    0.8   
      0.9  <br>
       <br>
      -->linspace(0,0.99,10)<br>
       ans  =<br>
       <br>
          0.    0.11    0.22    0.33    0.44    0.55    0.66    0.77   
      0.88    0.99 <br>
      <br>
      Hope this helped.<br>
      <br>
      Regards,<br>
      Radovan<br>
      <pre style="font-family:Monospaced;font-style:normal;font-size:13.0;"><span style="color:rgb(74,85,219);">
</span></pre>
      On 7/9/2014 8:15 AM, tanthiamhuat wrote:<br>
    </div>
    <blockquote cite="mid:1404886535714-4030857.post@n3.nabble.com"
      type="cite">
      <pre wrap="">yes, I understand now. how about second part of the question that

x=[0:0.1:2*%pi]'; 
y=sin(x);plot(x,y) 
why does the above 2 lines give a plot which does not touch the x-axis at
x=2*pi? also, it seems not to be exact at (0,0). 
see <a class="moz-txt-link-freetext" href="http://postimg.org/image/4t4pcqub5/">http://postimg.org/image/4t4pcqub5/</a> 



--
View this message in context: <a class="moz-txt-link-freetext" href="http://mailinglists.scilab.org/Plotting-why-wrong-values-on-the-x-and-y-axes-tp4030855p4030857.html">http://mailinglists.scilab.org/Plotting-why-wrong-values-on-the-x-and-y-axes-tp4030855p4030857.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>

</pre>
    </blockquote>
    <br>
  
<br /><br />
<hr style='border:none; color:#909090; background-color:#B0B0B0; height: 1px; width: 99%;' />
<table style='border-collapse:collapse;border:none;'>
        <tr>
                <td style='border:none;padding:0px 15px 0px 8px'>
                        <a href="http://www.avast.com/">
                                <img border=0 src="http://static.avast.com/emails/avast-mail-stamp.png" />
                        </a>
                </td>
                <td>
                        <p style='color:#3d4d5a; font-family:"Calibri","Verdana","Arial","Helvetica"; font-size:12pt;'>
                                This email is free from viruses and malware because <a href="http://www.avast.com/">avast! Antivirus</a> protection is active.
                        </p>
                </td>
        </tr>
</table>
<br />
</body>
</html>