|
In R2008b, I define a symbolic piecewise function:
f = evalin (symengine, 'piecewise ([x>=0 and x<=pi, 1], [x>pi and x<2*pi, -1])');
Is there a way to use ezplot to plot this function? The obvious usage does not work:
ezplot (f)
??? Error using ==> inlineeval at 15
Error in inline expression ==> piecewise([x in (pi, 2.*pi), -1], [x in [0, pi], 1])
Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.
Error in ==> inline.feval at 36
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in ==> ezplotfeval at 54
z = feval(f,x(1),y(1));
Error in ==> ezplot>ezimplicit at 253
u = ezplotfeval(f,X,Y);
Error in ==> ezplot at 153
hp = ezimplicit(cax,f{1},vars,labels,args{:});
Error in ==> sym.ezplot at 45
h = ezplot(char(f));
Unfortunately, matlabFuntion does not work either:
matlabFunction (f)
??? Error: Unbalanced or unexpected parenthesis or bracket.
Error in ==> sym.matlabFunction>makeFhandle at 98
SUBS_Fhandle = eval(['@(' SUBS_xvarnames ')' vectorize(SUBS_body)]);
Error in ==> sym.matlabFunction at 93
g = makeFhandle(varnames,vectorize(body));
|