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

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

Added original make3d

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