source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/@sdpvar/polynomial.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 729 bytes
Line 
1function [p,c,v] = polynomial(x,dmax,dmin)
2%POLYNOMIAL Creates parameterized polynomial
3%
4% [p,c,v] = polynomial(x,dmax,dmin)
5%
6% POLYNOMIAL is a quick way to define a parameterized polynomial p=c'*v,
7% with all monomials of dmin <= degree(p,x) <= dmax. The coefficients in
8% the polynomial are c while v is the monomial basis.
9%
10% Example:
11%
12% Paramterized quartic
13%  x = sdpvar(2,1);
14%  p = polynomial(x,4);
15%
16% See also MONOLIST, COEFFICIENTS
17
18% Author Johan Löfberg
19% $Id: polynomial.m,v 1.3 2006/08/16 15:57:36 joloef Exp $
20
21if nargin<3
22    dmin = 0;
23end
24
25v = monolist(x,dmax);
26if dmin <= dmax & dmin>0
27    s = nchoosek(length(x) + dmin-1,dmin-1);
28    v = extsubsref(v,s+1:length(v));
29end
30c = sdpvar(length(v),1);
31p = c'*v;
Note: See TracBrowser for help on using the repository browser.