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 8709849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:28:22+00:00 2026-06-13T04:28:22+00:00

I have a bunch of data, and I want a fitting with a function

  • 0

I have a bunch of data, and I want a fitting with a function that I want, for example, 1/(ax^2+bx+c). My objective is to get a,b,c values.

Is there any function of MATLAB that helps with this? I have been checking the fit() function, but I didn’t reach a conclusion. Which is the best way?

  • 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-13T04:28:23+00:00Added an answer on June 13, 2026 at 4:28 am

    The model you give can be solved using simple methods:

    % model function
    f = @(a,b,c,x) 1./(a*x.^2+b*x+c);
    
    % noise function 
    noise = @(z) 0.005*randn(size(z));
    
    % parameters to find
    a = +3;
    b = +4;
    c = -8;
    
    % exmample data
    x = -2:0.01:2;    x = x + noise(x);
    y = f(a,b,c, x);  y = y + noise(y);
    
    
    % create linear system Ax = b, with 
    % A = [x²  x  1]
    % x = [a; b; c]
    % b = 1/y;
    A = bsxfun(@power, x.', 2:-1:0);
    
    A\(1./y.')
    

    Result:

    ans = 
     3.035753123094593e+00  % (a)
     4.029749103502019e+00  % (b)
    -8.038644874704120e+00  % (c)
    

    This is possible because the model you give is a linear one, in which case the backslash operator will give the solution (the 1./y is a bit dangerous though…)

    When fitting non-linear models, take a look at lsqcurvefit (optimization toolbox), or you can write your own implementation using fmincon (optimization toolbox), fminsearch or fminunc.

    Also, if you happen to have the curve fitting toolbox, type help curvefit and start there.

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

Sidebar

Related Questions

I have a bunch of data that i want to insert and i have
I have a django view generating a bunch of data which I want to
I have just scraped a bunch of Google Buzz data, and I want to
So in my app I have a bunch of data that I'd like to
I have a bunch of overloaded functions that operate on certain data types such
I have a php array that has a bunch of data that I need
I have an app that has a bunch of Core Data that it needs
I have a .net assembly that contains data access code (a bunch of Typed
I have bunch of temporal data which I want to convert to RDF format.
i have a bunch of data collection , example : 1.00 3 4 1.00

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.