<html>
  <head>
    <meta content="text/html; charset=UTF-8"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hello,<br>
      <br>
      You can try spline interpolation and numerical derivatives on that
      spline<br>
      <pre style="font-family:Monospaced;font-style:normal;font-size:16.0;"><span style="color:rgb(100,174,100);font-style:italic;">//function for spline interpolation of x-y data</span>
<span style="color:rgb(50,185,185);">deff</span> <span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">[yk] = fspline(xx,x,y)</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(255,170,0);">...</span>
      <span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">yk=interp(xx, x, y, splin(x,y))</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;
</span><span style="color:rgb(100,174,100);font-style:italic;">//</span>
<span style="color:rgb(100,174,100);font-style:italic;">//Use the spline for finding derivatives</span>
<span style="color:rgb(100,174,100);font-style:italic;">//</span>
<span style="color:rgb(0,0,0);">a</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">10</span> <span style="color:rgb(100,174,100);font-style:italic;">//give the point</span>
<span style="color:rgb(174,92,176);text-decoration:underline;">numdiff</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">fspline</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">a</span><span style="color:rgb(74,85,219);">)</span> <span style="color:rgb(100,174,100);font-style:italic;">//find the derivative at the point</span>
<span style="color:rgb(100,174,100);font-style:italic;">//derivatives at the x points</span>
<span style="color:rgb(160,32,240);">for</span> <span style="color:rgb(0,0,0);">i</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(255,170,0);">:</span><span style="color:rgb(50,185,185);">length</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">x</span><span style="color:rgb(74,85,219);">)</span>
    <span style="color:rgb(0,0,0);">dy</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(174,92,176);text-decoration:underline;">numdiff</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">fspline</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">x</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
    <span style="color:rgb(50,185,185);">mprintf</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">x=%i, dy=%f\n</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">x</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">dy</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(0,0,0);">i</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(160,32,240);">end</span></pre>
      Regards,<br>
      Radovan<br>
      <br>
      On 3/22/2014 7:00 PM, Samuel Enibe wrote:<br>
    </div>
    <blockquote
cite="mid:CAJKcLoUfEQDNBhqQ8YgTf+-iEkdHmwVCkTrqMQ7qL73S7uhtBA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>I would like to use the functions <b>derivative</b> or <b>numdiff</b>
            to numerically differentiate a tabulated data such as<br>
            <br>
            x = [0 2 5 20 40 60 80]';//time in minutes    <br>
            y = [0.0956820 0.0480457 0.0277857 0.0036214 0.0002543
            0.0002543 0.0001265]';//values of y<br>
            <br>
          </div>
          May I know the best way to determine dy/dx for the data set.<br>
          <br>
        </div>
        Thank you very much and God bless you<br>
        <div>
          <div><br clear="all">
            <div>
              <div>
                <div dir="ltr">Samuel Ogbonna Enibe<br>
                  University of Nigeria, Nsukka, Nigeria<br>
                  Tel: +2348063646798<br>
                  Email: <a moz-do-not-send="true"
                    href="mailto:samuel.enibe@unn.edu.ng"
                    target="_blank">samuel.enibe@unn.edu.ng</a><br>
                       <a moz-do-not-send="true"
                    href="mailto:enibesam@yahoo.com" target="_blank">enibesam@yahoo.com</a></div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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;'>
                                Ova e-pošta je nema virusa i zlonamjernih programa jer <a href="http://www.avast.com/">avast! Antivirus</a> zaštita je aktivna.
                        </p>
                </td>
        </tr>
</table>
<br />
</body>
</html>