Matlab basic plot, gives error

Discussion in 'Programmer's Corner' started by hopelft, Mar 7, 2012.

  1. hopelft

    Thread Starter New Member

    Mar 7, 2012
    3
    0
    Hi everyone,
    I don't understand this error that I am getting when I just use the plot(x,y) command on matlab

    M =

    2.0000 -1.5000 0 1.5000
    2.0000 -3.0000 7.5000 -3.5000

    EDU>> x = @(t) M(1,1) + M(1,2)*t + M(1,3)*t^2 + M(1,4)*t^3;
    EDU>> y = @(t) M(2,1) + M(2,2)*t + M(2,3)*t^2 + M(2,4)*t^3;
    EDU>> plot(x,y)
    ??? Error using ==> plot
    Conversion to double from function_handle is not possible.


    Can anyone help me please???!
     
  2. hopelft

    Thread Starter New Member

    Mar 7, 2012
    3
    0
    ok so i think part of the problem is that I should use
    EDU>> plot(x(t),y(t))
    but I get this message
    ??? Undefined function or variable 't'.

    help?
     
  3. hopelft

    Thread Starter New Member

    Mar 7, 2012
    3
    0
    I got the problem, thanks :)
     
Loading...