beta = base2reali(1/2)

beta =

     1

beta = base2reali(1/4)

beta =

     0     1

beta = base2reali(1/4+1/2)

beta =

     1     1

beta = base2reali(1/10)

beta =

  Columns 1 through 9

     0     0     0     1     1     0     0     1     1

  Columns 10 through 18

     0     0     1     1     0     0     1     1     0

  Columns 19 through 27

     0     1     1     0     0     1     1     0     0

  Columns 28 through 36

     1     1     0     0     1     1     0     0     1

  Columns 37 through 45

     1     0     0     1     1     0     0     1     1

  Columns 46 through 54

     0     0     1     1     0     0     1     1     0

  Column 55

     1

beta = base2reali(1/100)

beta =

  Columns 1 through 9

     0     0     0     0     0     0     1     0     1

  Columns 10 through 18

     0     0     0     1     1     1     1     0     1

  Columns 19 through 27

     0     1     1     1     0     0     0     0     1

  Columns 28 through 36

     0     1     0     0     0     1     1     1     1

  Columns 37 through 45

     0     1     0     1     1     1     0     0     0

  Columns 46 through 54

     0     1     0     1     0     0     0     1     1

  Columns 55 through 59

     1     1     0     1     1

  0     0     0     0     0     0  
   0     0     0     0     0     0  
        |
{Error: Unexpected MATLAB expression.
} 
beta = base2reali(pi/100)

beta =

  Columns 1 through 9

     0     0     0     0     1     0     0     0     0

  Columns 10 through 18

     0     0     0     1     0     1     0     1     1

  Columns 19 through 27

     0     1     1     1     1     1     1     1     0

  Columns 28 through 36

     0     1     0     0     1     0     0     0     0

  Columns 37 through 45

     1     0     1     1     1     0     0     1     0

  Columns 46 through 54

     0     1     1     1     0     0     0     1     1

  Columns 55 through 56

     0     1



scriptderivata
scriptderivata


help function
 <strong>function</strong> Add new function.
    New functions may be added to MATLAB's vocabulary if they
    are expressed in terms of other existing functions. The 
    commands and functions that comprise the new function must
    be put in a file whose name defines the name of the new 
    function, with a filename extension of '.m'. At the top of
    the file must be a line that contains the syntax definition
    for the new function. For example, the existence of a file 
    on disk called STAT.M with:
  
            function [mean,stdev] = stat(x)
            %STAT Interesting statistics.
            n = length(x);
            mean = sum(x) / n;
            stdev = sqrt(sum((x - mean).^2)/n);
  
    defines a new function called STAT that calculates the 
    mean and standard deviation of a vector. The variables
    within the body of the function are all local variables.
    See SCRIPT for procedures that work globally on the work-
    space. 
 
    A subfunction that is visible to the other functions in the
    same file is created by defining a new function with the <strong>function</strong>
    keyword after the body of the preceding function or subfunction.
    For example, avg is a subfunction within the file STAT.M:
 
           function [mean,stdev] = stat(x)
           %STAT Interesting statistics.
           n = length(x);
           mean = avg(x,n);
           stdev = sqrt(sum((x-avg(x,n)).^2)/n);
 
           %-------------------------
           function mean = avg(x,n)
           %AVG subfunction
           mean = sum(x)/n;
 
    Subfunctions are not visible outside the file where they are defined.
 
    You can terminate any function with an END statement but, in most
    cases, this is optional. END statements are required only in M-files 
    that employ one or more nested functions. Within such an M-file, 
    every function (including primary, nested, private, and subfunctions)
    must be terminated with an END statement. You can terminate any 
    function type with END, but doing so is not required unless the 
    M-file contains a nested function.
 
    Normally functions return when the end of the function is reached.
    A RETURN statement can be used to force an early return.
 
    See also <a href="matlab:help script">script</a>, <a href="matlab:help return">return</a>, <a href="matlab:help varargin">varargin</a>, <a href="matlab:help varargout">varargout</a>, <a href="matlab:help nargin">nargin</a>, <a href="matlab:help nargout">nargout</a>, 
             <a href="matlab:help inputname">inputname</a>, <a href="matlab:help mfilename">mfilename</a>.

    Reference page in Help browser
       <a href="matlab:doc function">doc function</a>

help handles

handles not found.

Use the Help browser search field to <a href="matlab:docsearch handles">search the documentation</a>, or
type "<a href="matlab:help help">help help</a>" for help command options, such as help for methods.

help feval
 <strong>feval</strong> Execute the specified function.
    <strong>feval</strong>(F,x1,...,xn) evaluates the function specified by a function
    handle or function name, F, at the given arguments, x1,...,xn.
    For example, if F = @foo, <strong>feval</strong>(F,9.64) is the same as foo(9.64).
 
    If a function handle is bound to more than one built-in or 
    M-file, (that is, it represents a set of overloaded functions), 
    then the data type of the arguments x1 through xn, determines 
    which function is executed.
 
    <strong>feval</strong> is usually used inside functions which take function
    handles or function strings as arguments.  Examples include 
    FZERO and EZPLOT.
 
    [y1,..,yn] = <strong>feval</strong>(F,x1,...,xn) returns multiple output arguments.
 
    Within methods that overload built-in functions, use BUILTIN(F,...)
    to execute the original built-in function.  Note that when using
    BUILTIN, F must be a function name and not a function handle.
 
    See also <a href="matlab:help assignin">assignin</a>, <a href="matlab:help function_handle">function_handle</a>, <a href="matlab:help functions">functions</a>, <a href="matlab:help builtin">builtin</a>, <a href="matlab:help eval">eval</a>, <a href="matlab:help evalin">evalin</a>.

    Overloaded methods:
       <a href="matlab:help inline/feval">inline/feval</a>

    Reference page in Help browser
       <a href="matlab:doc feval">doc feval</a>

help handle
  <strong>handle</strong>   Superclass of all handle classes.
    A handle is an object that indirectly references its data.  When a
    handle is constructed, an object with storage for property values is
    created.  The constructor returns a handle to this object.  When a
    handle object is copied, for example during assignment or when passed
    to a MATLAB function, the handle is copied but not the underlying
    object property values.
 
    The <strong>handle</strong> class is an abstract class and cannot be directly
    constructed.  It is the superclass for all classes that follow handle
    semantics.
 
    Classes that define events must be handle classes (i.e., they must be
    derived from <strong>handle</strong>).  Classes that are derived from the built-in 
    classes HGSETGET or DYNAMICPROPS become handle classes.  When defining 
    a class that inherits from two or more super-classes simultaneously,  
    all superclasses must be handle classes or none can be.  A derived 
    class cannot inherit from both handle and value classes simultaneously.
 
    Classes that are derived from <strong>handle</strong> inherit no properties, but do 
    inherit the following methods which can be overridden as needed.
 
  handle methods:
    <a href="matlab:help handle/addlistener">addlistener</a>  - Add listener for event.
    <a href="matlab:help handle/delete">delete</a>       - Delete a handle object.
    <a href="matlab:help handle/eq">eq</a>           - Test handle equality.
    <a href="matlab:help handle/findobj">findobj</a>      - Find objects with specified property values.
    <a href="matlab:help handle/findprop">findprop</a>     - Find property of MATLAB handle object.
    <a href="matlab:help handle/ge">ge</a>           - Greater than or equal relation.
    <a href="matlab:help handle/gt">gt</a>           - Greater than relation.
    <a href="matlab:help handle/isvalid">isvalid</a>      - Test handle validity.
    <a href="matlab:help handle/le">le</a>           - Less than or equal relation for handles.
    <a href="matlab:help handle/lt">lt</a>           - Less than relation for handles.
    <a href="matlab:help handle/ne">ne</a>           - Not equal relation for handles.
    <a href="matlab:help handle/notify">notify</a>       - Notify listeners of event.

    Reference page in Help browser
       <a href="matlab:doc handle">doc handle</a>


@calcolaeps

ans = 

    @calcolaeps

f=@calcolaeps

f = 

    @calcolaeps

f

f = 

    @calcolaeps

f()

ans =

   2.2204e-16

fi=@calcolaeps

fi = 

    @calcolaeps

fi()

ans =

   2.2204e-16


help inline
 <strong>inline</strong> Construct <strong>inline</strong> object.
    <strong>inline</strong>(EXPR) constructs an inline function object from the
    MATLAB expression contained in the string EXPR.  The input
    arguments are automatically determined by searching EXPR
    for variable names (see SYMVAR). If no variable exists, 'x'
    is used.
 
    <strong>inline</strong>(EXPR, ARG1, ARG2, ...) constructs an inline
    function whose input arguments are specified by the
    strings ARG1, ARG2, ...  Multicharacter symbol names may
    be used.
 
    <strong>inline</strong>(EXPR, N), where N is a scalar, constructs an
    inline function whose input arguments are 'x', 'P1',
    'P2', ..., 'PN'.
 
    Examples:
      g = inline('t^2')
      g = inline('sin(2*pi*f + theta)')
      g = inline('sin(2*pi*f + theta)', 'f', 'theta')
      g = inline('x^P1', 1)
 
    See also <a href="matlab:help inline/symvar">symvar</a>.

    Reference page in Help browser
       <a href="matlab:doc inline">doc inline</a>

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

f1 =

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

f1(2)

ans =

     6

g = inline('exp(x)')

g =

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

[df_a,h,err_misto]= rapp_incr(g,1,1e-4,1e-4)

df_a =

    2.7189


h =

   4.8828e-04


err_misto =

    0.8925

abs( df_a - exp(1))

ans =

   6.6375e-04

abs( df_a - exp(1))/abs(exp(1))

ans =

   2.4418e-04


abs( df_a - exp(1))/(1e-4+1e-4*abs(exp(1)))

ans =

    1.7851


[df_a,h,err_misto]= rapp_incr(g,1,1e-4,1e-4)

df_a =

    2.7186


h =

   2.4414e-04


err_misto =

    0.8925


abs( df_a - exp(1))/(1e-4+1e-4*abs(exp(1)))

ans =

    0.8925

[df_a,h,err_misto]= rapp_incr(g,1,1e-4,1e-4)

df_a =

    2.7186


h =

   4.8828e-04


err_misto =

    0.8925

abs( df_a - exp(1))/(1e-4+1e-4*abs(exp(1)))

ans =

    0.8925

[df_a,h,err_misto]= rapp_incr(g,1,1e-14,1e-14)

df_a =

    2.7183


h =

   3.7253e-09


err_misto =

     0

abs( df_a - exp(1))/(1e-14+1e-14*abs(exp(1)))

ans =

   2.2201e+06

abs( df_a - exp(1))/(1e-8+1e-8*abs(exp(1)))

ans =

    2.2201

abs( df_a - exp(1))/(1e-7+1e-7*abs(exp(1)))

ans =

    0.2220

[df_a,h,err_misto]= rapp_incr(g,1,1e-6,1e-6)

df_a =

    2.7183


h =

   3.8147e-06


err_misto =

    0.6972

abs( df_a - exp(1))/(1e-6+1e-6*abs(exp(1)))

ans =

    0.6972

[df_a,h,err_misto]= rapp_incr(g,1,1e-8,1e-8)

df_a =

    2.7183


h =

   2.9802e-08


err_misto =

    0.8015

abs( df_a - exp(1))/(1e-8+1e-8*abs(exp(1)))

ans =

    0.1845

[df_a,h,err_misto]= rapp_incr(g,1,1e-9,1e-9)

df_a =

    2.7183


h =

   3.7253e-09


err_misto =

     0

abs( df_a - exp(1))/(1e-9+1e-9*abs(exp(1)))

ans =

   22.2007


A=rand(100);B=rand(100);
tic, CM = A*B; toc
Elapsed time is 0.000550 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000551 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000572 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000540 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000393 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000278 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000475 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000390 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000547 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000399 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000496 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000287 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000326 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000311 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000281 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000271 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000374 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000399 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000550 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000394 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000269 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000330 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000330 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000498 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000521 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000482 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000448 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000550 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000395 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000329 seconds.
tic, C = prodottorc(A,B); toc
Elapsed time is 0.018256 seconds.
tic, C = prodottorc(A,B); toc
Elapsed time is 0.014015 seconds.
tic, C = prodottorc(A,B); toc
Elapsed time is 0.014125 seconds.
tic, C = prodottorc(A,B); toc
Elapsed time is 0.014036 seconds.
A=rand(1000);B=rand(1000);
tic, CM = A*B; toc
Elapsed time is 0.120320 seconds.
tic, C = prodottorc(A,B); toc
Elapsed time is 17.039808 seconds.
norm(C-CM)

ans =

   1.3002e-11

norm(C-CM,'inf')

ans =

   1.7897e-10

A=rand(100);B=rand(100);
tic, C = prodottorc(A,B); toc
Elapsed time is 0.014454 seconds.
tic, CM = A*B; toc
Elapsed time is 0.000676 seconds.
norm(C-CM,'inf')

ans =

     0

tic, C = prodottorc(A,B); toc
Elapsed time is 0.018267 seconds.
tic, C = prodottorc(A,B); toc
Elapsed time is 0.015522 seconds.
A=rand(1000);B=rand(1000);
tic, C = prodottorc(A,B); toc
Elapsed time is 18.507776 seconds.
[df_a,h,err_misto]= rapp_incr(g,1,1e-9,1e-9)

err_misto =

   1.0728e+08


err_misto =

   4.9484e+07


err_misto =

   2.3772e+07


err_misto =

   1.1652e+07


err_misto =

   5.7683e+06


err_misto =

   2.8699e+06


err_misto =

   1.4314e+06


err_misto =

   7.1481e+05


err_misto =

   3.5718e+05


err_misto =

   1.7854e+05


err_misto =

   8.9254e+04


err_misto =

   4.4624e+04


err_misto =

   2.2311e+04


err_misto =

   1.1155e+04


err_misto =

   5.5776e+03


err_misto =

   2.7888e+03


err_misto =

   1.3944e+03


err_misto =

  697.2175


err_misto =

  348.6558


err_misto =

  174.3279


err_misto =

   87.1640


err_misto =

   44.0829


err_misto =

   23.0434


err_misto =

   10.0188


err_misto =

    8.0151


err_misto =

    8.0151


err_misto =

   16.0302


err_misto =

     0


df_a =

    2.7183


h =

   3.7253e-09


err_misto =

     0


[df_a,h,err_misto]= rapp_incr(g,1,1e-14,1e-14)

err_misto =

   1.0728e+13


err_misto =

   4.9484e+12


err_misto =

   2.3772e+12


err_misto =

   1.1652e+12


err_misto =

   5.7683e+11


err_misto =

   2.8699e+11


err_misto =

   1.4314e+11


err_misto =

   7.1481e+10


err_misto =

   3.5718e+10


err_misto =

   1.7854e+10


err_misto =

   8.9254e+09


err_misto =

   4.4624e+09


err_misto =

   2.2311e+09


err_misto =

   1.1155e+09


err_misto =

   5.5776e+08


err_misto =

   2.7888e+08


err_misto =

   1.3944e+08


err_misto =

   6.9722e+07


err_misto =

   3.4866e+07


err_misto =

   1.7433e+07


err_misto =

   8.7164e+06


err_misto =

   4.4083e+06


err_misto =

   2.3043e+06


err_misto =

   1.0019e+06


err_misto =

   8.0151e+05


err_misto =

   8.0151e+05


err_misto =

   1.6030e+06


err_misto =

     0


df_a =

    2.7183


h =

   3.7253e-09


err_misto =

     0


[df_a,h,err_misto]= rapp_incr(g,1,1e-14,1e-14)

err_misto =

   1.0728e+13


err_misto =

   4.9484e+12


err_misto =

   2.3772e+12


err_misto =

   1.1652e+12


err_misto =

   5.7683e+11


err_misto =

   2.8699e+11


err_misto =

   1.4314e+11


err_misto =

   7.1481e+10


err_misto =

   3.5718e+10


err_misto =

   1.7854e+10


err_misto =

   8.9254e+09


err_misto =

   4.4624e+09


err_misto =

   2.2311e+09


err_misto =

   1.1155e+09


err_misto =

   5.5776e+08


err_misto =

   2.7888e+08


err_misto =

   1.3944e+08


err_misto =

   6.9722e+07


err_misto =

   3.4866e+07


err_misto =

   1.7433e+07


err_misto =

   8.7164e+06


err_misto =

   4.4083e+06


err_misto =

   2.3043e+06


err_misto =

   1.0019e+06


err_misto =

   8.0151e+05


err_misto =

   8.0151e+05


err_misto =

   1.6030e+06


err_misto =

     0

{Warning:  err_misto > 1} 
{> In <a href="matlab: opentoline('/home/docenti/mazzia/laboratorio2013/gruppoB/rapp_incr.m',28,1)">rapp_incr at 28</a>} 

df_a =

    2.7183


h =

   3.7253e-09


err_misto =

   1.6030e+06

abs( df_a - exp(1))/(1e-14+1e-14*abs(exp(1)))

ans =

   2.2201e+06

[df_a,h,err_misto]= rapp_incr(g,1,1e-9,1e-9)

err_misto =

   1.0728e+08


err_misto =

   4.9484e+07


err_misto =

   2.3772e+07


err_misto =

   1.1652e+07


err_misto =

   5.7683e+06


err_misto =

   2.8699e+06


err_misto =

   1.4314e+06


err_misto =

   7.1481e+05


err_misto =

   3.5718e+05


err_misto =

   1.7854e+05


err_misto =

   8.9254e+04


err_misto =

   4.4624e+04


err_misto =

   2.2311e+04


err_misto =

   1.1155e+04


err_misto =

   5.5776e+03


err_misto =

   2.7888e+03


err_misto =

   1.3944e+03


err_misto =

  697.2175


err_misto =

  348.6558


err_misto =

  174.3279


err_misto =

   87.1640


err_misto =

   44.0829


err_misto =

   23.0434


err_misto =

   10.0188


err_misto =

    8.0151


err_misto =

    8.0151


err_misto =

   16.0302


err_misto =

     0

{Warning:  err_misto > 1} 
{> In <a href="matlab: opentoline('/home/docenti/mazzia/laboratorio2013/gruppoB/rapp_incr.m',28,1)">rapp_incr at 28</a>} 

df_a =

    2.7183


h =

   3.7253e-09


err_misto =

   16.0302

abs( df_a - exp(1))/(1e-9+1e-9*abs(exp(1)))

ans =

   22.2007


[df_a,h,err_misto]= rapp_incr(g,1,1e-8,1e-8)

err_misto =

   1.0728e+07


err_misto =

   4.9484e+06


err_misto =

   2.3772e+06


err_misto =

   1.1652e+06


err_misto =

   5.7683e+05


err_misto =

   2.8699e+05


err_misto =

   1.4314e+05


err_misto =

   7.1481e+04


err_misto =

   3.5718e+04


err_misto =

   1.7854e+04


err_misto =

   8.9254e+03


err_misto =

   4.4624e+03


err_misto =

   2.2311e+03


err_misto =

   1.1155e+03


err_misto =

  557.7595


err_misto =

  278.8786


err_misto =

  139.4387


err_misto =

   69.7217


err_misto =

   34.8656


err_misto =

   17.4328


err_misto =

    8.7164


err_misto =

    4.4083


err_misto =

    2.3043


err_misto =

    1.0019


err_misto =

    0.8015


df_a =

    2.7183


h =

   2.9802e-08


err_misto =

    0.8015

abs( df_a - exp(1))/(1e-8+1e-8*abs(exp(1)))

ans =

    0.1845

[df_a,h,err_misto]= rapp_incr(g,1,1e-8,1e-8)

err_misto =

   1.0728e+07


err_misto =

   4.9484e+06


err_misto =

   2.3772e+06


err_misto =

   1.1652e+06


err_misto =

   5.7683e+05


err_misto =

   2.8699e+05


err_misto =

   1.4314e+05


err_misto =

   7.1481e+04


err_misto =

   3.5718e+04


err_misto =

   1.7854e+04


err_misto =

   8.9254e+03


err_misto =

   4.4624e+03


err_misto =

   2.2311e+03


err_misto =

   1.1155e+03


err_misto =

  557.7595


err_misto =

  278.8786


err_misto =

  139.4387


err_misto =

   69.7217


err_misto =

   34.8656


err_misto =

   17.4328


err_misto =

    8.7164


err_misto =

    4.4083


err_misto =

    2.3043


err_misto =

    1.0019


err_misto =

    0.8015


df_a =

    2.7183


h =

   2.9802e-08


err_misto =

    0.8015

diary off
