19 lines
547 B
Mathematica
19 lines
547 B
Mathematica
function [ output_args ] = main(type)
|
|
//MAIN Spezifiziert einen Unit-Test fuer die 2. Programmieraufgabe
|
|
|
|
//Setzt das Format fuer Ausgabe (wissenschaftliche Darstellung)
|
|
format("e",8)
|
|
|
|
//Aufruf der Benutzer-definierten Funktionen
|
|
//Teilaufgabe a): Finde die kleinste Zahl, so dass (1.0+eps>1.0)
|
|
e = findeps()
|
|
|
|
//Teilaufgabe b): Berechne eine Approximation an PI
|
|
//fuer type =1 oder type=2
|
|
p = approxpi(35, type)
|
|
|
|
//Grafische Darstellung
|
|
//plot(p, '--rs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',10)
|
|
|
|
endfunction
|