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

[Matlab] Error running optimization.

Tags:
  1. May 21, 2014 #1
    Error running optimization. Inputs must be a scalar and a square matri

    I am trying to use fminunc using optimtool. But i got the error

    Error running optimization.
    Inputs must be a scalar and a square matrix.


    this is the function i typed in the editor.

    function F = fun(x)
    F = -0.2662*x^6 + 48.19*x^5 - 3424.2*x^4 + 121708*x^3 - 2*e^6*x^2 + 2*e^7*x - 6*e^7;
    end


    i am not sure if this is a simple problem in matlab..i just want to optimize it using fminunc..i am new to matlab and there are a lot of things i do not understand.can you help me?
     
  2. jcsd
  3. May 22, 2014 #2

    DrClaude

    User Avatar

    Staff: Mentor

    Could you please post the code where you call fminunc?
     
  4. May 22, 2014 #3

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    Not sure if the error message is related to this error that you are making. You are trying to find the unconstrained minimum of a polynomial whose largest power term is -0.2662*x^6. This has no minimum. It goes down to -infinity.

    If you fix that and still have a problem you should show how you are calling fminunc.
     
  5. May 22, 2014 #4
    sir what method did you use to find that the term -0.2662*x^6 has no minimum?
     
  6. May 22, 2014 #5

    kreil

    User Avatar
    Gold Member

    Last edited: May 22, 2014
  7. May 23, 2014 #6

    FactChecker

    User Avatar
    Science Advisor
    Gold Member

    For unconstrained large values of x, x^6 is even larger. -0.2662*x^6 is unbounded negative and has no minimum.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: [Matlab] Error running optimization.
  1. MATLAB Runs Filename (Replies: 2)

  2. Matlab Error (Replies: 1)

  3. Error code in Matlab (Replies: 3)

Loading...