aboutsummaryrefslogtreecommitdiffstats
path: root/buch/chapters/040-rekursion/gammalimit/l.m
diff options
context:
space:
mode:
authorRunterer <37069007+Runterer@users.noreply.github.com>2022-08-06 11:00:54 +0200
committerGitHub <noreply@github.com>2022-08-06 11:00:54 +0200
commit72f13d47f42a7005889532fd29bcfc870f4e5051 (patch)
tree559c39cde661ea56759051c9b7965fb28468cfb6 /buch/chapters/040-rekursion/gammalimit/l.m
parentminor presentation improvements (diff)
parentMerge pull request #42 from daHugen/master (diff)
downloadSeminarSpezielleFunktionen-72f13d47f42a7005889532fd29bcfc870f4e5051.tar.gz
SeminarSpezielleFunktionen-72f13d47f42a7005889532fd29bcfc870f4e5051.zip
Merge branch 'AndreasFMueller:master' into master
Diffstat (limited to 'buch/chapters/040-rekursion/gammalimit/l.m')
-rw-r--r--buch/chapters/040-rekursion/gammalimit/l.m19
1 files changed, 19 insertions, 0 deletions
diff --git a/buch/chapters/040-rekursion/gammalimit/l.m b/buch/chapters/040-rekursion/gammalimit/l.m
new file mode 100644
index 0000000..32b6442
--- /dev/null
+++ b/buch/chapters/040-rekursion/gammalimit/l.m
@@ -0,0 +1,19 @@
+#
+# l.m -- Berechnung der Gamma-Funktion
+#
+# (c) 2022 Prof Dr Andreas Müller, OST Ostschweizer Fachhochschule
+#
+global N;
+N = 10000;
+
+function retval = gamma(x, n)
+ p = 1;
+ for k = (1:n)
+ p = p * k / (x + k - 1);
+ end
+ retval = p * n^(x-1);
+endfunction
+
+for n = (100:100:N)
+ printf("Gamma(%4d) = %10f\n", n, gamma(0.5, n));
+end