Mercurial > repos > public > sbplib
view vandermonde.m @ 826:b94bb6ffa38b feature/operator_files
rename d2_2 to D1_standard_2
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Mon, 10 Sep 2018 17:48:48 +0200 |
parents | 0090a86d8b72 |
children |
line wrap: on
line source
% Create vandermonde matrix for points x and polynomials of order p % x is a list of N points of size [N,dim], % p is a list of polynomial orders of size [M, dim]. % the given mononomials are evaluated and the NxM matrix V is returned. function V = vandermonde(x, p) assert(size(x,2) == size(p,2), 'x and p must have the same number of columns') n = size(x,1); m = size(p,1); for i = 1:m V(:,i) = mononomial(x, p(i,:)); end assertSize(V,[n,m]); end