GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • YALMIP
  • Download
  • Tutorials
  • Examples
  • Inside
  • Commands
  • Solvers
  • Index
  • FAQ
  • References
  • Forum
  • Search
  • sdpvar
  • optimize

This view

  • Original page
  • New address

GeezerVison is showing yalmip.github.io — coefficients

coefficients is used to extract coefficients in a polynomial.

Syntax

[c,v] = coefficients(p,x)

Examples

Define a polynomial in variables x and y, with coefficients parameterized by s and t.

sdpvar x y s t
p = x^2+x*y*(s+t)+s^2+t^2;

The coefficients are easily recovered

c = coefficients(p,[x y]);
sdisplay(c)

ans =
    's^2+t^2'
    's+t'
    '1'

By adding a second output, the monomial basis is returned also.

[c,v] = coefficients(p,[x y]);
sdisplay([c v])

ans =
    's^2+t^2'    '1'  
    's+t'        'xy'
    '1'          'x^2'
p-c'*v

ans =
     0

Of course, we might just as well consider this to be a polynomial in s and t with coefficients parameterized by x and y.

[c,v] = coefficients(p,[s t]);
sdisplay([c v])

ans =
    'x^2'    '1'  
    'x*y'     't'  
    '1'      't^2'
    'x*y'     's'  
    '1'      's^2'
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.