disp(' Prüfung SS 1999 Aufgabe 3 '); % 27.06.2001 % x=-6:1:6; fx=1./(exp(x.^2)+1); p1=polyfit(x,fx,12); % x-> 13 Stützstellen -> PolyGrad min. 12 % t=-6:0.05:6; % Stützstellen zum Zeichnen von ... pol=polyval(p1,t); % Interpolationspolynom funk=1./(exp(t.^2)+1); % Funktion selbst (zum Zeichnen) sp=spline(x,fx,t); % Spline % x = Eingang Stützstellen % fx= Funktion % t = zum zeichnen % plot(t,funk,'r',t,pol,'g',t,sp,'b',x,fx,'k*') legend('Funktion','Polynominterpolation','Spline','Stützstellen',4) %3.Quatrant title('Interpolation') xlabel('x-Achse') ylabel('y-Achse') gtext('Polynominterpolation ist hier nicht gut')