%Aufgabe2
%Gegeben seien zwei Vektoren f und x der Länge n.
%Bilden Sie je einen Vektor

[m,n]=size(f);

%der Differenz zweier benachbarter Elemente des Vektors f
%----------------------------------------------------------
%for
for k=1:1:n-1;
    vek11(k)=f(k)-f(k+1);    
end

%while
k=1;
while k<=n-1; 
    vek12(k)=f(k)-f(k+1);
    k=k+1;
end

%Marix
vek13=f(1:n-1)-f(2:n);

A=[vek11; vek12; vek13]

clear vek11;
clear vek12;
clear vek13;


%des Quotienten der korrespondierenden Elemente von f und x
%-----------------------------------------------------------

%for
for k=1:1:n;
    vek21(k)=f(k)/x(k);    
end

%while
k=1;
while k<=n; 
    vek22(k)=f(k)/x(k);
    k=k+1;
end

%Marix
vek23=f./x;

B=[vek21; vek22; vek23]
clear vek21;
clear vek22;
clear vek23;



%des Quotienten der korrespondierenden Differenz der jeweils 
%benachbarten Elemente von f und x.
%-------------------------------------------------------------

%for
for k=1:1:n-1;
    vek31(k)=(f(k)-f(k+1))/(x(k)-x(k+1));    
end

%while
k=1;
while k<=n-1; 
    vek32(k)=(f(k)-f(k+1))/(x(k)-x(k+1));
    k=k+1;
end

%Marix
vek33=(f(1:n-1)-f(2:n))./(x(1:n-1)-x(2:n));

C=[vek31; vek32; vek33]
clear vek31;
clear vek32;
clear vek33;
