Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8416661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:49:32+00:00 2026-06-10T01:49:32+00:00

I am trying to fit a huge function with four unknown parameter to my

  • 0

I am trying to fit a huge function with four unknown parameter to my data with levenberg-Marquardt least square method in Matlab. I used this command :

[x, resnorm]=lsqcurvefit(@myfun1,[-100:100], xdata, ydata, ...
                         [-inf, -inf, -1.5, -inf], [inf, inf, 1.5, inf], options)

which means I am interested to constrain the third parameter. But I face with this problem:

??? Error using ==> lsqncommon at 102
Levenberg-Marquardt and Gauss-Newton algorithms do not handle bound constraints and trust-region-reflective algorithm
requires at least as many equations as variables; aborting.

Error in ==> lsqcurvefit at 258
[xCurrent,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = ...

I think this error shows that my data is small since they are 36 points or maybe there are too many unknown parameters, but I think four unknown parameters for fitting is fine!

so, what do you think ?Does it mean that MATLAB is not able to fit my function to this 36 points data?

I’d appreciate any comments.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:49:33+00:00Added an answer on June 10, 2026 at 1:49 am

    According to this http://www.mathworks.co.uk/help/toolbox/optim/ug/lsqcurvefit.html the second argument is the the start values of the parameters that you wish to optimise for. You are passing in

     [-100:100]
    

    which (unless matlab has greatly changed since I last used it) is a vector of 201 parameters and so it would seem that you are asking matlab to optimise over 201 parameters. As @Dan points out in the comment below, you only have 36 data points and so what you are asking is unreasonable . You want to optimise over just 4 params so you should input just 4 start values. You are passing in length 4 vectors for the limit options so you have an inconsistency here.

    I would suggest just inputting a vector of 4 start values for your parameters as second argument and see if it generates the outcome you expect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to fit the information from the G function of my data to
I'm trying to use scipy.leastsq() as a method of finding a best fit point
I am trying to draw smooth, bezier-type curves to fit a set of data
I am trying to fit collected data to a polynomial equation and I found
I'm trying to fit a function consisting of several gauss bells to some experimental
I am trying to fit a distribution to some data I've collected from microscopy
I'm trying to fit a logistic growth curve to my data using curve_fit using
I'm trying to fit a curve over (the tail of) the following data: [1]
I'm trying to fit some data and stuff, I know there is a simple
I'm trying to fit some data to a lognormal distribution and from this generate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.