view matrixcomp/seqcheb.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 x = seqcheb(n, k)
%SEQCHEB   Sequence of points related to Chebyshev polynomials.
%          X = SEQCHEB(N, K) produces a row vector of length N.
%          There are two choices:
%              K = 1:  zeros of T_N,         (the default)
%              K = 2:  extrema of T_{N-1},
%          where T_k is the Chebsyhev polynomial of degree k.

if nargin == 1, k = 1; end

if k == 1                     %  Zeros of T_n
   i = 1:n; j = .5*ones(1,n);
   x = cos( (i-j) * (pi/n) );
elseif k == 2                 %  Extrema of T_(n-1)
   i = 0:n-1;
   x = cos( i * (pi/(n-1)) );
end