f = inline('exp(x)')

f =

     Inline function:
     f(x) = exp(x)

df = inline('exp(x)')

df =

     Inline function:
     df(x) = exp(x)

[da, err, h]= rappincr(@f,1, 1e-5, 1e-5)
{Error: "f" was previously used as a variable,
 conflicting with its use here as the name of a function
 or command.
 See <a href="matlab: helpview([docroot '/techdoc/matlab_prog/matlab_prog.map'],'function_call_command_syntax')">MATLAB Programming, "How MATLAB Recognizes Function
 Calls That Use Command Syntax"</a> for details.
} 
[da, err, h]= rappincr(f,1, 1e-5, 1e-5)

da =

    2.7183


err =

    0.5578


h =

   3.0518e-05

abs( da-df(1))/(1e-5+1e-5*abs(df(1)))

ans =

    1.1155

f1 = inline('x^3-2')

f1 =

     Inline function:
     f1(x) = x^3-2

cd ..
cd gruppoB
diary off
g = inline('exp(x)')

g =

     Inline function:
     g(x) = exp(x)

dg = inline('exp(x)')

dg =

     Inline function:
     dg(x) = exp(x)

[da, err, h]= rappincr(g,1, 1e-5, 1e-5)

da =

    2.7183


err =

    0.5578


h =

   1.5259e-05

abs(da-dg(1))/(1e-5+1e-5*abs(dg(1)))

ans =

    0.5578

[da, err, h]= rappincr(g,1, 1e-12, 1e-12)

da =

    2.7183


err =

     0


h =

   3.7253e-09

abs(da-dg(1))/(1e-12+1e-12*abs(dg(1)))

ans =

   2.2201e+04

[da, err, h]= rappincr(g,1, 1e-8, 1e-8)

da =

    2.7183


err =

     0


h =

   3.7253e-09

abs(da-dg(1))/(1e-12+1e-12*abs(dg(1)))

ans =

   2.2201e+04

[da, err, h]= rappincr(g,1, 1e-8, 1e-8)

da =

    2.7183


err =

     0


h =

   3.7253e-09

[da, err, h]= rappincr(g,1, 1e-7, 1e-7)

da =

    2.7183


err =

    0.8817


h =

   2.3842e-07

abs(da-dg(1))/(1e-7+1e-7*abs(dg(1)))

ans =

    0.8700

[da, err, h]= rappincr(g,1, 1e-8, 1e-8)
{Warning: l'approssimazione non e' accurata} 
{> In <a href="matlab: opentoline('/home/docenti/mazzia/laboratorio2013/gruppoA/rappincr.m',29,1)">rappincr at 29</a>} 

da =

    2.7183


err =

    3.2060


h =

   3.7253e-09

abs(da-dg(1))/(1e-8+1e-8*abs(dg(1)))

ans =

    2.2201

[da, err, h]= rappincr(g,1, 1e-12, 1e-12)
{Warning: l'approssimazione non e' accurata} 
{> In <a href="matlab: opentoline('/home/docenti/mazzia/laboratorio2013/gruppoA/rappincr.m',29,1)">rappincr at 29</a>} 

da =

    2.7183


err =

   3.2060e+04


h =

   3.7253e-09

abs(da-dg(1))/(1e-12+1e-12*abs(dg(1)))

ans =

   2.2201e+04


pol1( [1 -2 1],1)

ans =

     0

pol1( [1 -2 1],2)

ans =

     1

pol2( [1 -2 1],2)

ans =

     1

pol2( [1 -2 1],3)

ans =

     4

pol2( [1 -2 1],3)

ans =

     4

pol1( [1 -2 1],3)

ans =

     4

horn( [1 -2 1],3)

y =

     1


y =

     1


y =

     4


ans =

     4

horn( [1 -2 1],3)

y =

     1


ans =

     4

horn( [1 -2 1],[3;5])
{Error using <a href="matlab:helpUtils.errorDocCallback('mtimes')" style="font-weight:bold"> * </a>
Inner matrix dimensions must agree.

Error in <a href="matlab:helpUtils.errorDocCallback('horn', '/home/docenti/mazzia/laboratorio2013/gruppoA/horn.m', 13)" style="font-weight:bold">horn</a> (<a href="matlab: opentoline('/home/docenti/mazzia/laboratorio2013/gruppoA/horn.m',13,0)">line 13</a>)
    y = y*x + p(i);
} 
horn( [1 -2 1],[3;5])

ans =

     4
    16

scriptpol
{Error using <a href="matlab:helpUtils.errorDocCallback('pol1', '/home/docenti/mazzia/laboratorio2013/gruppoA/pol1.m', 10)" style="font-weight:bold">pol1</a> (<a href="matlab: opentoline('/home/docenti/mazzia/laboratorio2013/gruppoA/pol1.m',10,0)">line 10</a>)
Not enough input arguments.

Error in <a href="matlab:helpUtils.errorDocCallback('scriptpol', '/home/docenti/mazzia/laboratorio2013/gruppoA/scriptpol.m', 9)" style="font-weight:bold">scriptpol</a> (<a href="matlab: opentoline('/home/docenti/mazzia/laboratorio2013/gruppoA/scriptpol.m',9,0)">line 9</a>)
y1 = pol1(x);
} 
helpUtils.errorDocCallback('pol1', '/home/docenti/mazzia/laboratorio2013/gruppoA/pol1.m', 10)
scriptpol
scriptpol
