% Das ist ein Kommentar % demo 14.10. clear % Loesche alle Variablen clc % loescht das Command window x = [ -1 2.3 4] A = [ 1, 2 ,3 ; -2, -5,6]; whos % grafik y(x) clear clc x = [-5, -4, -3, -2, -1, 0, 1, 2]; x = linspace(-5,5,101); y = sqrt(abs(x)); plot(x,y); hold on % alte Grafik bleibt erhalten z = exp( sin(x).^2 ) + x; plot(x,z); hold off % alte Grafik darf ueberschr. wedren % mehrerer Grafiken, siehe auch plot --> LineSpec plot(x,y,'-.or',x,z,'LineWidth',4) xlabel('x-achse') ylabel('y') title('2 Funktionen'); legend('sqrt(abs(x))','exp( sin(x).^2 ) + x') saveas(gcf,'demo_1.jpg') % Speichere die Grafik in ein jpg-File save demo_1.mat % Speichere Matlab-Variablen in das File clear load demo_1.mat % Lade die Variablen aus dem File % Nutzen unsere Funktion test [a,am] = test(x.*x, y-2)