Roberto Espinoza Jr.
Roberto Espinoza Jr.
  • 1
  • 51 220
How to write a curve-fitting Matlab script
This tutorial will guide you through writing a Matlab script that fits a curve to a set of data. I use a sine function as an example, but this method can be extended for use in many other functions suh as exponential functions, polynomials, square roots, etc.
All files, including the scripts written in this video (complete with helpful comments) are available for download at:
-------------------------------------OUTDATED LINK---------------------------------------
drive.google.com/drive/folders/0B9YNVsGr_QsPU3VUOFFfU2ZiMnM?usp=sharing
-------------------------------------NEW LINK-------------------------------------------------
drive.google.com/drive/folders/0B9YNVsGr_QsPU3VUOFFfU2ZiMnM?resourcekey=0-vOo7dUMBhpBFNpyISSqe7w&usp=sharing
มุมมอง: 51 220

วีดีโอ

ความคิดเห็น

  • @-maroute-myroad7511
    @-maroute-myroad7511 2 ปีที่แล้ว

    please can you help me !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @JackSparrow-yt3qw
    @JackSparrow-yt3qw 3 ปีที่แล้ว

    I have a non linear curve from a bending test, how may I know which equation would be suitable for data fitting?

  • @musavincentshabalala4712
    @musavincentshabalala4712 3 ปีที่แล้ว

    Thank you for this tutorial. My question is, how to fit an equation to the data gathered during an experiment?

  • @dariomiric2958
    @dariomiric2958 4 ปีที่แล้ว

    Thanks for the tutorial, it helped :) Do you know how can I find the minimum of objective function (ds) after finding optimal parameters?

  • @subhadipchakrabortty4192
    @subhadipchakrabortty4192 4 ปีที่แล้ว

    can I fit it by using a double integral equation?

  • @sattwikaacharya_math.musica
    @sattwikaacharya_math.musica 4 ปีที่แล้ว

    Sir, can you please elaborate this method for a system of ODEs

  • @surajbhosale9791
    @surajbhosale9791 5 ปีที่แล้ว

    good job

  • @princekakran8734
    @princekakran8734 5 ปีที่แล้ว

    please explain again how you took the values of C3 & C4

  • @nicolaisirbu5819
    @nicolaisirbu5819 5 ปีที่แล้ว

    Hy. Very useful. The problem is that the results are very sensible to the initial guess for the parameters to be estimate. Maybe it's just for my function that i adjust using your scripts as example. What is to be done to get the same results no matter what initial values are adopted?

  • @namitgaur
    @namitgaur 5 ปีที่แล้ว

    I am doing a curve fit to data using fminsearch. Unfortunately the fit does not converge. Can you please suggest alternatives?

  • @briankrohnke1569
    @briankrohnke1569 6 ปีที่แล้ว

    Fminsearch has an error

  • @LuthandoMaqondo
    @LuthandoMaqondo 6 ปีที่แล้ว

    Very very helpful

  • @Bosco12ful
    @Bosco12ful 6 ปีที่แล้ว

    Hi, I have this eq. df/dt=f(n+5)-f(n)/T, T is the time (data) and f the frequency(data). I want to use the window of 100ms. How can I achieve that with a curve fitting? I need to get df/dt .

  • @yarasd2749
    @yarasd2749 6 ปีที่แล้ว

    can you advice me : I have a set of data i want to plot it in points then find the best fit of this data using a function I have, but i dont have a fixed range and this initial guess , because i want to make it with GUI and the user can upload different set of data every time. the fitting equation we have but there is one variable in this function we need to calculate it according to our curve ...is it possible

  • @samarjitsingh4166
    @samarjitsingh4166 6 ปีที่แล้ว

    how to fit two functions with same parameters in matlab. Plz help me in this regard

  • @farahfaroha1548
    @farahfaroha1548 6 ปีที่แล้ว

    I couldn't download the files, how can l do it

  • @zalasyu
    @zalasyu 6 ปีที่แล้ว

    I get this error using you layout for my program: Assignment has more non-singleton rhs dimensions than non-singleton subscripts Error in fminsearch (line 200) fv(:,1) = funfcn(x,varargin{:}); Error in Lab_Report_3 (line 33) C = fminsearch(@ds,[18 0.017 -3.1 18])

  • @musafir1068
    @musafir1068 6 ปีที่แล้ว

    can you again elaborate the values of C1, C2, C3and C4

  • @agnivogosai6764
    @agnivogosai6764 6 ปีที่แล้ว

    Can you make a video showing the confidence interval for the curve fit ?

    • @talkohavy
      @talkohavy 5 ปีที่แล้ว

      I don't think he knows what you mean. It's not like he did chi-squared test or anything.

  • @mateuszsz8720
    @mateuszsz8720 6 ปีที่แล้ว

    Hello Roberto, are you able to show me how to apply it for a circle fitting using least-squares method?

  • @sandeep8585
    @sandeep8585 7 ปีที่แล้ว

    Thanks a lot....Such a beautiful Explanation. !!

  • @3happyD
    @3happyD 7 ปีที่แล้ว

    Hi, I have a polynomial SUM equations, where my goal is to calculate the 'n' value for the polynomial function, and observe 'n' equals to what number gives me a better fitting to my data set. My question is if this is achievable using Matlab?

  • @krishnachandrasharma8133
    @krishnachandrasharma8133 7 ปีที่แล้ว

    What if the equation itself is in a differential form?

    • @robertoespinozajr.7226
      @robertoespinozajr.7226 7 ปีที่แล้ว

      Hello, do you mind clarifying your question? Are you are looking to fit a curve to data that is the solution to a differential equation? To the extent of my knowledge, you'll have to solve the differential equation in order to attempt to fit anything. Whether or not this equation has a closed form solution is another problem altogether. There are, however, different numerical methods to solving differential equations, and you can plot both your data and the approximate solution on the same plot. Let me know if I understood your question correctly so I know how I can help :)

  • @papess690
    @papess690 7 ปีที่แล้ว

    Thank you very much! I have't realize it need to import by column!

  • @suntem7
    @suntem7 7 ปีที่แล้ว

    This helped a lot. Thanks

  • @aliakil1249
    @aliakil1249 7 ปีที่แล้ว

    Thank you Roberto, this was very helpful!