Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [tsans] = taylorsin(x,n)
- % Startwert und Datentyp ans
- tsans = 0;
- % Loop Summe
- for i = 0:n
- % Terme für loop
- T1 = ( ( - 1 ) ^ i );
- T2 = ( x ^ ( 2 * i + 1 ) );
- T3 = factorial( 2 * i + 1 );
- % Loop
- tsans = tsans + ( T1 * ( T2 / T3 ) );
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement