sdisplay

Updated:


sdisplay (symbolic display) tries to display an sdpvar object in symbolic MATLAB form.

Syntax

s = sdisplay(p,[digits])

Examples

sdisplay is useful for displaying polynomial sdpvar objects

x = sdpvar(1,1);y = sdpvar(1,1);
f = [x;x^2+y+x*y];
sdisplay(f)

ans =
    'x'
    'y+x^2+x*y'

By supplying a seond argument, we can control the number of digits displayed (the expression is rounded to N digits)

x = sdpvar(1,1);
sdisplay(pi*x,3)
  ans = '3.141*x'

Comments

The command tries to find the symbolic names of variables, but this can fail in some instances, such as when the variable has been defined outside the current scope. Additionally, variables defined using nonlinear operators beyond polynomials can currently not be displayed.

Leave a Comment