MATLAB Tutorial Lesson #08: Interpolation and Polynomial Curve Fitting

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • Description

КОМЕНТАРІ • 29

  • @matej5071
    @matej5071 3 роки тому +1

    this was great! I really appreciate when someone is able to create such a comprehensive lecture. Thank you!!

  • @jabeen5835
    @jabeen5835 Рік тому

    Thank you so much this SOOO helpful ❤

  • @melisakalafat3863
    @melisakalafat3863 7 років тому +1

    great tutorial!! it helped me a lot thank you

  • @mmanouri
    @mmanouri 8 років тому +1

    That's a nice tutorial!

  • @marcelaburgos4872
    @marcelaburgos4872 8 років тому +4

    Can you show how can i write the interpolation, but for 3d points (x,y,z)

  • @lpsoldier8627
    @lpsoldier8627 7 років тому

    u are phenomenal!

  • @steliosgallidis9778
    @steliosgallidis9778 5 років тому

    saved the day dude wp !!

  • @ronniewang932
    @ronniewang932 7 років тому

    awesome tutorial

  • @DrSlough
    @DrSlough 8 років тому +1

    thanks for the help!

  • @zainmubarak8679
    @zainmubarak8679 5 років тому

    thanks for help sir

  • @shadmanshahriar9003
    @shadmanshahriar9003 8 років тому

    It was a great tutorial , can you please supply the code . It would be very helpful .

  • @ayshaalkhazraji7355
    @ayshaalkhazraji7355 7 років тому

    life saver

  • @mirzasalkic5252
    @mirzasalkic5252 5 років тому

    Can we write cubic spline instead of order and get the coefficients like we did when setting the order of the polynomial?

    • @matthewrhudy2324
      @matthewrhudy2324  5 років тому

      cubic spline is different than fitting a third order polynomial to a data set. Effectively, the cubic spline fits cubic function between each set of points, so you would have a piecewise function of many third order polynomials. I am not sure if there is a way to get these coefficients, but depending on the number of points there would be a lot of them. Try digging into the options of the interp1 function if you want to explore this.

    • @mirzasalkic5252
      @mirzasalkic5252 5 років тому

      @@matthewrhudy2324 The real problem is to get one precise equation in the large interval.Is that even possible?Btw cubic spline obtains polynomials at each break,like you said,but can it be constructed on the larger interval and still be precise..

    • @alperensglm1
      @alperensglm1 4 роки тому

      @@matthewrhudy2324 can you please help me about my homework? i can not do anything about matlab programming because of pandemic situations. even i couldn't get lessons well. Please sir, it's so important for me my question is;
      Natural Cubic Spline Interpolation
      Choose x0, x1, x2, x3 and y0, y1, y2, y3. Write an .m file to compute the third order polynomials for the intervals [x0, x1], [x1, x2], [x2, x3]. Plot the functions and the points xi, yi on the same figure. Figure should clearly show that the polynomials pass through the points.
      I will choose my own xi, yi and test your code

  • @alperensglm1
    @alperensglm1 4 роки тому

    can you please help me about my homework? i can not do anything about matlab programming because of pandemic situations. even i couldn't get lessons well. Please sir, it's so important for me my question is;
    Natural Cubic Spline Interpolation
    Choose x0, x1, x2, x3 and y0, y1, y2, y3. Write an .m file to compute the third order polynomials for the intervals [x0, x1], [x1, x2], [x2, x3]. Plot the functions and the points xi, yi on the same figure. Figure should clearly show that the polynomials pass through the points.
    I will choose my own xi, yi and test your code

    • @matthewrhudy2324
      @matthewrhudy2324  4 роки тому +1

      This is covered in the video, it might just be some confusion in understanding your problem. The terms x0, x1, etc. are just the components of the vector that I called x. The interp1 function can do spline interpolation, you just need to set the option

  • @ziia0528
    @ziia0528 7 років тому

    great... by the way interp1 or interpl ?

    • @matthewrhudy2324
      @matthewrhudy2324  7 років тому +1

      Great question, this is a very common mistake since the "one" and "ell" look very similar in the MATLAB font. It is interp-"one" not L.

  • @Devishhike
    @Devishhike 7 років тому

    What will happen if x(i) will be equal to x(i+1)? I mean array of x will be like x= [-2 1 1 2 3 3 4]? All codes provide NaN coefficient in polinom because division by 0 how to avoid it. could u give any suggestions?

    • @matthewrhudy2324
      @matthewrhudy2324  7 років тому

      I would need more information to help. I do not understand what you are trying to do.

    • @Devishhike
      @Devishhike 7 років тому

      I have to make newton polynom from array of x= [-2 -1 1 1 4 5];f(x) = [11 3 5 2 8 9] to make this polynom u need to calculate divided differences f(x0;x1)= (f(x1)-f(x0))/(x1-x0) but when x(i)=x(i+1) (5 - 3) / (1 - 1) we have division by zero what should i do???

    • @matthewrhudy2324
      @matthewrhudy2324  7 років тому +1

      Seems to me that this is not a function since you have two f(x) values for the same x value of 1. This is why you will hit errors.

    • @Devishhike
      @Devishhike 7 років тому

      I was thinkinh about this, and it seems really strange" two f(x) values for the same x value of 1" but EXCEL perfectly calcutes that polynom

    • @alperensglm1
      @alperensglm1 4 роки тому

      @@matthewrhudy2324 can you please help me about my homework? i can not do anything about matlab programming because of pandemic situations. even i couldn't get lessons well. Please sir, it's so important for me my question is;
      Natural Cubic Spline Interpolation
      Choose x0, x1, x2, x3 and y0, y1, y2, y3. Write an .m file to compute the third order polynomials for the intervals [x0, x1], [x1, x2], [x2, x3]. Plot the functions and the points xi, yi on the same figure. Figure should clearly show that the polynomials pass through the points.
      I will choose my own xi, yi and test your code