This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
gibson:teaching:fall-2013:math445:hw3solns [2013/10/22 19:48] gibson |
gibson:teaching:fall-2013:math445:hw3solns [2013/10/22 19:51] (current) gibson |
||
|---|---|---|---|
| Line 177: | Line 177: | ||
| where //x// and //y// range from -10 to 10. Label the axes. | where //x// and //y// range from -10 to 10. Label the axes. | ||
| - | </code> | + | <code> |
| N = length(x); | N = length(x); | ||
| F = zeros(N,N); | F = zeros(N,N); | ||
| Line 223: | Line 223: | ||
| <code> | <code> | ||
| - | function f = factorial2(n) | + | function f = factorial2(n) |
| - | % factorial2: compute n! | + | % factorial2: compute n! |
| - | f = 1; | + | f = 1; |
| - | while (n>1); | + | while (n>1); |
| - | f = f*n; | + | f = f*n; |
| - | n = n-1; | + | n = n-1; |
| - | end | + | |
| end | end | ||
| + | end | ||
| </code> | </code> | ||
| Line 276: | Line 276: | ||
| end | end | ||
| end | end | ||
| - | <code> | + | </code> |