Results 1 to 1 of 1

Math Help - MatLab - Can't understand error

  1. #1
    Member
    Joined
    Sep 2010
    Posts
    95

    MatLab - Can't understand error

    MatLab:
    ??? Error using ==> mtimes
    Inner matrix dimensions must agree.

    Error in ==> test at 12

    f = x(3) + x(2) * y + x(1) * y * y;


    I'mtrying to plot a polynom I just made, or trying to make. And I can understand which matrix size that's messing things up.
    Code:
    t = [0 0.5 1.0 1.5 2.0]';
    c = [0 0.19 0.26 0.29 0.31]';
    
    A = [t.*t, t, ones(length(t),1)];
    %Normal equations:
    order = 2;
    x = zeros((order+1),1);
    x = A\c;
    
    y = 0:0.1:2;
    f = zeros(length(y),1);
    f = x(3) + x(2) * y + x(1) * y * y;
    
    plot(f,y);
    I'm quite new to MatLab, so bear with me...
    Last edited by liquidFuzz; May 19th 2011 at 01:28 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. matlab error Hdiv, L2, H1
    Posted in the Math Software Forum
    Replies: 0
    Last Post: July 17th 2010, 08:16 AM
  2. Simpsons 3.8 rule, error help matlab
    Posted in the Math Software Forum
    Replies: 3
    Last Post: May 10th 2010, 06:31 AM
  3. MATLAB error
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 31st 2010, 10:39 AM
  4. Matlab programming error help
    Posted in the Math Software Forum
    Replies: 7
    Last Post: February 1st 2010, 07:25 PM
  5. Matlab doesn't gives an error when processing
    Posted in the Math Software Forum
    Replies: 1
    Last Post: September 4th 2009, 02:05 PM

Search Tags


/mathhelpforum @mathhelpforum