zeichneFunktion.m

% Beispiel: Plot von Funktionen
t = 0:0.1:4*pi;
y = sin(t);
y2 = 0.5*log(t);
y3 = exp(-0.1*t.*t);

plot(t, y, "bo", t, y2, "g.", t, y3, "r-.", [0, 4*pi], [0, 0], "k-")
title("Meine Lieblingsfunktionen", ...
      "FontSize", 14, "FontWeight", "bold")
xlabel("Zeit");
ylabel("Auslenkung");
xlim([0, 4*pi])
legend("Sinus", "Logarithmus", "Glocke", "Location", "best");

% Plot als Datei abspeichern
F = getframe(gcf);
imwrite(F.cdata, "bild06.png");