Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab help with ezplot

Tags:
  1. Jun 6, 2014 #1
    d = x^2 –6*x – 12;

    >> ezplot(d)
    Error using inlineeval (line 15)
    Error in inline expression ==> x.^2 –6.*x – 12
    Error: The input character is not valid in MATLAB statements or
    expressions.

    Error in inline/feval (line 34)
    INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr,
    INLINE_OBJ_.expr);

    Error in ezplotfeval (line 52)
    z = feval(f,x(1));

    Error in ezplot>ezplot1 (line 469)
    [y, f, loopflag] = ezplotfeval(f, x);

    Error in ezplot (line 145)
    [hp, cax] = ezplot1(cax, f{1}, vars, labels, args{:});


    what is the problem here?
     
  2. jcsd
  3. Jun 6, 2014 #2

    kreil

    User Avatar
    Gold Member

    From the doc:

    "ezplot(fun) plots the expression fun(x) over the default domain -2π < x < 2π, where fun(x) is an explicit function of only x.

    fun can be a function handle or a string."

    What you input is neither a function handle:

    d = @(x) x.^2 - 6.*x -12;
    ezplot(d)


    nor a string:

    d = 'x^2 - 6*x-12';
    ezplot(d)




    http://www.mathworks.com/help/matlab/ref/ezplot.html
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Matlab help with ezplot
  1. MATLAB help (Replies: 0)

  2. MATLAB help (Replies: 7)

  3. MATLAB ezplot error (Replies: 1)

  4. Matlab help (Replies: 6)

Loading...