help imagesc
 IMAGESC Scale data and display as image.
    IMAGESC(...) is the same as IMAGE(...) except the data is scaled
    to use the full colormap.
    
    IMAGESC(...,CLIM) where CLIM = [CLOW CHIGH] can specify the
    scaling.
 
    See also <a href="matlab:help image">image</a>, <a href="matlab:help colorbar">colorbar</a>, <a href="matlab:help imread">imread</a>, <a href="matlab:help imwrite">imwrite</a>.

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

clc
% grafico di funzioni di due 
% variabili
% Si usano le funzioni meshgrid()
% e surf().
% La prima cosa e' creare una griglia
% di punti nel piano dove valutare la
% funzione f(x,y)
[ X, Y ] = meshgrid( [-1 0 1],[2 3 4] )

X =

    -1     0     1
    -1     0     1
    -1     0     1


Y =

     2     2     2
     3     3     3
     4     4     4

% valutiiamo f(x,y)=x^2-y^2 nei punti in
% questione
Z = X.^2-Y.^2

Z =

    -3    -4    -3
    -8    -9    -8
   -15   -16   -15

% vediamo come fare un grafico decente
x = linspace(-1,1,100);
y = linspace(-2,2,100);
[ X, Y ] = meshgrid( x,y );
Z = X.^2-Y.^2;
surf(X,Y,Z)
surf(X,Y,Z),shading interp
colorbar
xlabel('x','fontSize',18)
ylabel('y','fontSize',18)
zlabel('z','fontSize',18)
doc surf
 Overloaded functions or methods (ones with the same name in other directories)
   <a href="matlab:doc fixedpoint/surf">doc fixedpoint/surf</a>

figure(2)
contour(X,Y,Z)
doc contour
 Overloaded functions or methods (ones with the same name in other directories)
   <a href="matlab:doc fixedpoint/contour">doc fixedpoint/contour</a>

% esercizio: grafico di f(x,y)=x*y
% in [-3,3]x[-2,2]
clear
x = linspace(-3,3,100);
y = linspace(-2,2,100);
[ X, Y ] = meshgrid( x,y );
Z = X.*Y;
surf(X,Y,Z),shading interp,colorbar
edit
clc
% Modify expression to add input arguments.
% Example:
%   a = [1 2 3; 4 5 6]; 
%   foo(a);

testNewton
??? Attempted to access
y(2); index out of bounds
because numel(y)=1.

Error in ==> <a href="matlab: opentoline('/home/accounts/personale/brtrrt72/aa2014_15/lez_5/newtonsys.m',17,0)">newtonsys at
17</a>
y(2) = y(2)+dz(2); %
y1<--y0+dy

Error in ==> <a href="matlab: opentoline('/home/accounts/personale/brtrrt72/aa2014_15/lez_5/testNewton.m',33,0)">testNewton
at 33</a>
[ x, y ] =
newtonsys(2,3,1E-6,100);

 opentoline('/home/accounts/personale/brtrrt72/aa2014_15/lez_5/newtonsys.m',17,0)
clear,clc
testNewton
whos x y
  Name      Size            Bytes  Class     Attributes

  x         1x16              128  double              
  y         1x16              128  double              

[x' y']

ans =

    2.0000    3.0000
    1.3235    1.9763
    0.8599    1.2631
    0.5209    0.7092
    0.2185    0.0621
    5.6423   -3.3546
    3.7652   -2.2296
    2.5185   -1.4711
    1.6983   -0.9466
    1.1786   -0.5561
    0.9105   -0.2192
    0.9454    0.0268
    1.0023   -0.0032
    1.0000   -0.0000
    1.0000    0.0000
    1.0000   -0.0000

plot(x,y,'-om','lineWidth',3)
clear,clc
testNewton
[x' y']

ans =

    1.0000    3.0000
    0.6400    1.9800
    0.3642    1.2749
    0.0819    0.7498
   -0.5176    0.3734
   -0.0871    1.0256
   -0.3682    0.7368
   -0.5404    0.8841
   -0.5018    0.8657
   -0.5000    0.8660
   -0.5000    0.8660
   -0.5000    0.8660

clear,clc
bacinoConvergenza
??? Error using ==>
image
Value must be a column
or row vector

Error in ==> <a href="matlab: opentoline('/usr/local/matlab-R2008a/toolbox/matlab/specgraph/imagesc.m',21,0)">imagesc at
21</a>
    hh =
    image(varargin{:},'CDataMapping','scaled');
    
Error in ==>
<a href="matlab: opentoline('/home/accounts/personale/brtrrt72/aa2014_15/lez_5/bacinoConvergenza.m',34,0)">bacinoConvergenza at 34</a>
imagesc(X0,Y0,qualeRadice)

whos
  Name              Size            Bytes  Class     Attributes

  X0               20x20             3200  double              
  Y0               20x20             3200  double              
  i                 1x1                 8  double              
  j                 1x1                 8  double              
  numPunti          1x1                 8  double              
  qualeRadice      20x20             3200  double              
  r1                2x1                16  double              
  r2                2x1                16  double              
  r3                2x1                16  double              
  x                 1x9                72  double              
  x0                1x20              160  double              
  xf                1x1                 8  double              
  y                 1x9                72  double              
  y0                1x20              160  double              
  yf                1x1                 8  double              

qualeRadice

qualeRadice =

  Columns 1 through 6

     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     2     3     3     2     3     1
     1     1     1     3     1     1
     1     1     1     2     1     1
     3     2     2     3     2     1
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2

  Columns 7 through 12

     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     3     3
     3     3     3     3     1     2
     3     3     3     3     2     2
     3     3     3     3     2     2
     3     3     3     3     2     2
     1     1     1     3     2     1
     1     1     1     2     3     1
     2     2     2     2     3     3
     2     2     2     2     3     3
     2     2     2     2     3     3
     2     2     2     2     1     3
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2
     2     2     2     2     2     2

  Columns 13 through 18

     3     3     2     2     2     3
     3     2     2     2     2     1
     3     3     2     3     1     1
     1     1     1     1     1     1
     2     2     3     1     1     1
     2     2     3     1     1     1
     2     2     1     1     1     1
     2     3     1     1     1     1
     3     1     1     1     1     1
     1     1     1     1     1     1
     1     1     1     1     1     1
     2     1     1     1     1     1
     3     2     1     1     1     1
     3     3     1     1     1     1
     3     3     2     1     1     1
     3     3     2     1     1     1
     1     1     1     1     1     1
     2     2     3     2     1     1
     2     3     3     3     3     1
     2     2     3     3     3     2

  Columns 19 through 20

     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1
     1     1

imagesc(X0,Y0,qualeRadice)
??? Error using ==> image
Value must be a column or row vector

Error in ==> <a href="matlab: opentoline('/usr/local/matlab-R2008a/toolbox/matlab/specgraph/imagesc.m',21,0)">imagesc at 21</a>
    hh =
    image(varargin{:},'CDataMapping','scaled');

imagesc(qualeRadice)
clear,clc
bacinoConvergenza
bacinoConvergenza
bacinoConvergenza
bacinoConvergenza
diary off
