comparison funm_files/fun_cos.m @ 0:8f23314345f4 draft

Create local repository for matrix toolboxes. Step #0 done.
author Antonio Pino Robles <data.script93@gmail.com>
date Wed, 06 May 2015 14:56:53 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8f23314345f4
1 function f = fun_cos(x,k)
2 %FUN_COS
3
4 if nargin < 2 | k == 0
5 f = cos(x);
6 else
7 g = mod(ceil(k/2),2);
8 h = mod(k,2);
9 if h == 1
10 f = sin(x)*(-1)^g;
11 else
12 f = cos(x)*(-1)^g;
13 end
14 end