Skip to main content
Engineering LibreTexts

Ocatve examples

  • Page ID
    24384
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    An NPV example in Octave
    pkg load financial
    r=.03/12;
    p=(1:60)*1000;
    npv(r,p)
    Hello world! Hello world!

    Histogram

     
     

     

     
    A data smoothing example in Octave
    pkg load data-smoothing
    npts = 20;
     x = rand(npts,1)*2*pi;
     y = sin(x);
     y = y + 1e-1*randn(npts,1);
     xh = linspace(0,2*pi,200)';
     [yh, lambda] = regdatasmooth (x, y, "d", 3, "xhat", xh);
     lambda
     plot(x,y,'o','markersize',10,xh,yh,xh,sin(xh))
     title("y(x)")
     legend("noisy","smoothed","sin(x)","location","northeast");
            hello world
          
    A linear algebra example in Octave
    A=randn(3,5);
    [u,s,v]=svd(A)
     

     


    This page titled Ocatve examples is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Kamran Iqbal.

    • Was this article helpful?