disp(' Prüfung SS 2000 Aufgabe 3 '); % 23.06.2001 % x=-5:1:5; % 11 Stützstellen y1=1./((sin(x)).^2+2); % Funktionswerte (komponentenweise) p1=polyfit(x,y1,10); % Polynom 10. Grades hat 11 Koeff. % t=-5:0.05:5; % Stützstellen zum Zeichnen von ... pol=polyval(p1,t); % Interpolationspolynom funk=1./((sin(t)).^2+2);% Funktion selbst sp=spline(x,y1,t); % Spline % x = Eingang Stützstellen % y1= Funktion % t = zum zeichnen % plot(t,funk,'r',t,sp,'b',x,y1,'k*',t,pol,'g') title('Interpolation und Splines') xlabel('x-Werte') ylabel('Funktionswerte') text(-1,0.55,'Splines sind toll')