>> a=rand(3,1)

a =

    0.8147
    0.9058
    0.1270

>> b=rand(1,3)

b =

    0.9134    0.6324    0.0975

>> size(a)

ans =

     3     1

>> size(b)

ans =

     1     3

>> length(a)

ans =

     3

>> length(b)

ans =

     3

>> c=rand(2,3)

c =

  Columns 1 through 2

    0.2785    0.9575
    0.5469    0.9649

  Column 3

    0.1576
    0.9706

>> size(c)

ans =

     2     3

>> length(c)

ans =

     3

>> DividedDiff([1,2],[3,4])

ans =

     1

>> DividedDiff([1;2],[3;4])

ans =

     1

>> DividedDiff([1,2],[3,4,2])
Error using DividedDiff (line
10)
Vectors have different
lengths.
 
>> a

a =

    0.8147
    0.9058
    0.1270

>> b

b =

  Columns 1 through 2

    0.9134    0.6324

  Column 3

    0.0975

>> c

c =

  Columns 1 through 2

    0.2785    0.9575
    0.5469    0.9649

  Column 3

    0.1576
    0.9706

>> DividedDiff(a,b)

ans =

   -5.4854

>> DividedDiff(a,c)
Error using DividedDiff (line
8)
All input must be vector.
 
>> isvector(a)

ans =

     1

>> isvector(b)

ans =

     1

>> isvector(c)

ans =

     0

>> x = [1,2,3]

x =

     1     2     3

>> a

a =

    0.8147
    0.9058
    0.1270

>> for i=1:3
display(a(i));
end

ans =

    0.8147


ans =

    0.9058


ans =

    0.1270

>> x = [1,2,3]

x =

     1     2     3

>> y = x.^2

y =

     1     4     9

>> for i=1:3
y(i) = x(i)^2;
end
>> y

y =

     1     4     9

>> xi = [1,2]

xi =

     1     2

>> yi = [3,4]

yi =

     3     4

>> px = Interpolation(xi, yi, 1)

px =

     3

>> px = Interpolation(xi, yi, 2)

px =

     4

>> x = 0:1/100:2;
>> px = Interpolation(xi, yi, x);
>> plot(x,px)
>> a

a =

    0.8147
    0.9058
    0.1270

>> b

b =

    0.9134    0.6324    0.0975

>> yi

yi =

     3     4

>> px = Interpolation(a, b, x);
>> plot(x,px)
>> 