diff options
author | Matthew Strapp <msattr@gmail.com> | 2019-10-14 10:10:14 -0500 |
---|---|---|
committer | Matthew Strapp <msattr@gmail.com> | 2019-10-14 10:10:14 -0500 |
commit | c944368c607add79fc3ea404629f717b42a834ce (patch) | |
tree | 78ae81ea0fc0d54ab532e8e0e5eaad2cc931c6b9 /math2373/lab5 | |
parent | Merge branch 'master' of github.com:RosstheRoss/TestingFun (diff) | |
download | homework-c944368c607add79fc3ea404629f717b42a834ce.tar homework-c944368c607add79fc3ea404629f717b42a834ce.tar.gz homework-c944368c607add79fc3ea404629f717b42a834ce.tar.bz2 homework-c944368c607add79fc3ea404629f717b42a834ce.tar.lz homework-c944368c607add79fc3ea404629f717b42a834ce.tar.xz homework-c944368c607add79fc3ea404629f717b42a834ce.tar.zst homework-c944368c607add79fc3ea404629f717b42a834ce.zip |
fix the oopsies
Diffstat (limited to 'math2373/lab5')
-rw-r--r-- | math2373/lab5/lab4.txt | 59 | ||||
-rw-r--r-- | math2373/lab5/multseries.m | 3 | ||||
-rw-r--r-- | math2373/lab5/sum_of_nn.m | 4 |
3 files changed, 62 insertions, 4 deletions
diff --git a/math2373/lab5/lab4.txt b/math2373/lab5/lab4.txt index e69de29..b45f0f3 100644 --- a/math2373/lab5/lab4.txt +++ b/math2373/lab5/lab4.txt @@ -0,0 +1,59 @@ +N=10; sum_of_fourths; y + +y = + + Columns 1 through 5 + + 0 1 17 98 354 + + Columns 6 through 10 + + 979 2275 4676 8772 15333 + + Column 11 + + 25333 + +N=10; sum_of_nn; y + +y = + + 1.2913 + +N=10; sum_of_nn; y + +y = + + 1.2913 + +N=10; multseries; y + +y = + + 3.0677 + +N=100; multseries; y + +y = + + 3.1338 + +N=1000; multseries; y + +y = + + 3.1408 + +N=10000; multseries; y + +y = + + 3.1415 + +N=100000; multseries; y + +y = + + 3.1416 + +diary off diff --git a/math2373/lab5/multseries.m b/math2373/lab5/multseries.m index ccd2533..d4b06d6 100644 --- a/math2373/lab5/multseries.m +++ b/math2373/lab5/multseries.m @@ -1,5 +1,4 @@ y=2; for n=1:N - x=y*((2*n)*(2*n))/((2*n-1)*(2*n+1)); - y=x; + y=y*((2*n)*(2*n))/((2*n-1)*(2*n+1)); end
\ No newline at end of file diff --git a/math2373/lab5/sum_of_nn.m b/math2373/lab5/sum_of_nn.m index ea36db5..dd191b7 100644 --- a/math2373/lab5/sum_of_nn.m +++ b/math2373/lab5/sum_of_nn.m @@ -1,4 +1,4 @@ -y(1)=0; +y=0; for n=1:N - y(n+1)=y(n)+1/(n^n); + y=y+1/(n^n); end
\ No newline at end of file |