view funm_files/fun_sin.m @ 7:e0817ccb2834 draft

Add square root matrix function file, rename atom at funm_files, modify old toolbox to run it inside GNU Octave. added funm_files/fun_atom.m added sqrtm2.m added toolbox/gecp.m toolbox/see.m: comment wrong call to subplot toolbox/tmtdemo.m: add a cast to double, as eig does not admit bool matrix input removed funm_files/funm_atom.m
author Antonio Pino Robles <data.script93@gmail.com>
date Tue, 26 May 2015 18:14:54 +0200
parents 8f23314345f4
children
line wrap: on
line source

function f = fun_sin(x,k)
%FUN_SIN

if nargin < 2 | k == 0
   f = sin(x);
else
   k = k - 1;
   g = mod(ceil(k/2),2);
   h = mod(k,2);
   if h == 1
      f = sin(x)*(-1)^g; 
   else
      f = cos(x)*(-1)^g; 
   end
end