diff options
author | Yanik Kuster <yanik.kuster@ost.ch> | 2022-04-06 11:24:10 +0200 |
---|---|---|
committer | Yanik Kuster <yanik.kuster@ost.ch> | 2022-04-06 11:24:10 +0200 |
commit | bf8e9cbcb82af445a28a05e4fbac02451d172365 (patch) | |
tree | 3a347b5ea7e31a9b204a27e7a24b4330106bb87a /buch/papers/dreieck/images/betadist.m | |
parent | added a picture to visualize example problem (diff) | |
parent | add missing exercise (diff) | |
download | SeminarSpezielleFunktionen-bf8e9cbcb82af445a28a05e4fbac02451d172365.tar.gz SeminarSpezielleFunktionen-bf8e9cbcb82af445a28a05e4fbac02451d172365.zip |
Merge branch 'master' of https://github.com/daHugen/SeminarSpezielleFunktionen
Diffstat (limited to '')
-rw-r--r-- | buch/papers/dreieck/images/betadist.m | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/buch/papers/dreieck/images/betadist.m b/buch/papers/dreieck/images/betadist.m index 9ff78ed..5b466a6 100644 --- a/buch/papers/dreieck/images/betadist.m +++ b/buch/papers/dreieck/images/betadist.m @@ -5,24 +5,32 @@ # global N; N = 201; -global n; -n = 11; +global nmin; +global nmax; +nmin = -4; +nmax = 7; +n = nmax - nmin + 1 +A = 3; -t = (0:n-1) / (n-1) -alpha = 1 + 4 * t.^2 +t = (nmin:nmax) / nmax; +alpha = 1 + A * t .* abs(t) +#alpha(1) = 0.01; #alpha = [ 1, 1.03, 1.05, 1.1, 1.25, 1.5, 2, 2.5, 3, 4, 5 ]; beta = alpha; names = [ "one"; "two"; "three"; "four"; "five"; "six"; "seven"; "eight"; - "nine"; "ten"; "eleven" ] + "nine"; "ten"; "eleven"; "twelve" ] function retval = Beta(a, b, x) retval = x^(a-1) * (1-x)^(b-1) / beta(a, b); + if (retval > 100) + retval = 100 + end end function plotbeta(fn, a, b, name) global N; - fprintf(fn, "\\def\\beta%s{\n", name); + fprintf(fn, "\\def\\beta%s{\n", strtrim(name)); fprintf(fn, "\t({%.4f*\\dx},{%.4f*\\dy})", 0, Beta(a, b, 0)); for x = (1:N-1)/(N-1) X = (1-cos(pi * x))/2; @@ -35,8 +43,8 @@ end fn = fopen("betapaths.tex", "w"); for i = (1:n) - fprintf(fn, "\\def\\alpha%s{%f}\n", names(i,:), alpha(i)); - fprintf(fn, "\\def\\beta%s{%f}\n", names(i,:), beta(i)); + fprintf(fn, "\\def\\alpha%s{%f}\n", strtrim(names(i,:)), alpha(i)); + fprintf(fn, "\\def\\beta%s{%f}\n", strtrim(names(i,:)), beta(i)); end for i = (1:n) |