MATLAB Help - Cubic Splines

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • Finally did Cubic Splines. This is a super long video but I finally got it. If you need help let me know.
    Root directory of repo
    github.com/cmo...
    As of 4/2021 this link below works.
    github.com/cmo...

КОМЕНТАРІ • 59

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

    That was a great video. I am a noob at coding but I knew the mathematics behind it and couldn't find a way to apply it. Your video gives a direction on how to think while coding. Was a big help, thanks!

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

    Thank you, it was really nice to see someone else's thought train while coding. Also, really laughed at the truck and yard work stuff :D They were as if they were put for comedy purposes :)

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

    I Love you man😁😘 You saved so much time😅

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

    Thank you so much

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

    Hi thanks for this upload. Very useful. I would like to ask if you are familiar with the PCHIP function on MATLAB and if it works on the same principle as this? From what I understand, the main difference between the various cubic spline algorithms is distinguished by the way the value of the first derivative, or gradient at a point is calculated or specified.

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

    Great video - Thank you so much for sharing! Will you please give us the link where we can get this code?

  • @ozsabr
    @ozsabr 6 років тому

    Very interesting!

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

    How would the code changed if you solved for the coefficients with an augmented matrix and row operations to get RREF?

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

      Change the line that says
      coeff = inv(H)*K
      to
      R =rref([H,K])
      coeff = R(:,end)
      I think that will work.

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

    is this is for natural boundary conditions? how different would it be if it was the case where the first derivatives at the endpoints are known?

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

      I guess you would just have to rederive the equations that I showed in the pdf. I don't think it would be too different.

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

      Ok thanks! And great video!

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

    Hii ,can u make a video on " draw a NURBS curve by calling b spline basis function "...i think it will helpful of many student

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

      Can you post a link to the method?

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

      @@samiachaudhuri257 Thanks for the link. Unfortunately I'm not familiar with that method.

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

    sir, how do we get the data-points , I have a robot which will start from 0 with initial v=0, a=0 , t=0 and then fv=0, fa=0 , t=10
    I see the values given to me like this but how is it derived.
    ankle_motion = deg2rad([-7.5 10 10 5 0 -10 -7.5]');
    knee_motion = deg2rad([10, -5, 2.5, -10, -10, 15, 10]');
    hip_motion = deg2rad([-10, -7.5, -15, 10, 15, 10, -10]');

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

      I think you're looking at the wrong video. If you have the initial conditions of the robot you need the equations of motion and then you need to integrate those EOMS with an Rk4 integrator or ode45

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

      @@CarlosMontalvo251 Sir , I need help on this , I think a 5th order polynomial equation is used but how do we get to know that it moves from -7.5 to 7.5 and how do we get the middle values.

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

      Are you trying to interpolate the knee-motion data set? If so you just need to use linear, quadratic or cubic interpolation

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

      @@CarlosMontalvo251 Sir I want to understand if I have a 2 link robot (D pendulum)with 2 deg of freedom , what should be the initial angle between the joints and how do we derive the way points as described above. Please suggest me, I have solved the polynomial equation but how and where to start the values is a difficult task, Please send me an email at sudhansumtripathy@gmail.com I will send you a simscape model which I have created so you can have a view on it (matlab2017) or I will save it in a lower version

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

      Ok now you're talking about robotic manipulation and pose estimation. This is not in my line of work. Like I said you need to go look at another video.

  • @118mutasimkouser8
    @118mutasimkouser8 3 роки тому

    sir, two point boundary value problem by using cubic spline. have any code??

    • @CarlosMontalvo251
      @CarlosMontalvo251  3 роки тому

      This is the only code I have related to Cubic Splines github.com/cmontalvo251/MATLAB/blob/master/Screen_Cast_Codes/Interpolation/cubicsplines.m

    • @118mutasimkouser8
      @118mutasimkouser8 3 роки тому

      Can I evaluated more then 4 points by using this code??

    • @CarlosMontalvo251
      @CarlosMontalvo251  3 роки тому

      @@118mutasimkouser8 The code will work for any number of data points.

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

    Sir, I want the code for Cubic bezier's surface with 16 points in Matlab, I am a research scholar in manufacturing

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

      Here's the code I used for Cubic Splines github.com/cmontalvo251/MATLAB Cube Bezier Curves sounds like something different.

    • @Rajesh-js4tl
      @Rajesh-js4tl 4 роки тому

      Meraj may I know your specialization please

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

      My specialty is in Dynamic Simulations and Control of Multibody Aerospace systems.

    • @Rajesh-js4tl
      @Rajesh-js4tl 4 роки тому

      @@CarlosMontalvo251 m.tech in cad/cam is useful or not sir

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

      @@CarlosMontalvo251 404 not found :(

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

    How can I do this code for 12*12 matrix instead of 10*10

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

      I don't think there would be any change to the code. The code uses the length() and size() functions to adequately handle any size matrices. Perhaps I'm mistaken?

  • @Serghey_83
    @Serghey_83 3 роки тому

    the equation
    UK [ði ɪˈkweɪʃən]
    US [ði ɪˈkweɪʒən] - Why /ʒ/ ????????

    • @CarlosMontalvo251
      @CarlosMontalvo251  3 роки тому

      I don't think the language translator came through correctly I only see random characters

  • @felipeobando7196
    @felipeobando7196 5 років тому +1

    where can I download the code? thanks

    • @cjcar178
      @cjcar178 5 років тому +1

      gitlab.com/Montalvo/MATLAB_Games.git

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

      Is there a way I can see the polynomial at the end of the program instead of the graph?

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

      @@felipeobando7196 Not really. The polynomial is a set of polynomials that intersect all of them. you basically have N-1 equations of the form ax^3 + bx^2 + cx + d. There's not a way to see "the" polynomials rather you have a set of polynomials.

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

    How do I interpolate for a specific X-value?

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

      At the bottom of the code if you change xsplines to one number I think it will work.

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

      @@CarlosMontalvo251 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. CAN YOU PLEASE HELP ME ??

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

      @@alperensglm1 I can help you. My youtube video above and the linked code on github will solve your problem with a few minor tweaks.

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

      Monte Carlos Thamk youuuu🙏 which headline does it include cubic splines? I didn’t find them unfortunatel, sir

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

      @@CarlosMontalvo251 Actually, i didn't find the cubic interpolation headline among of your github files. it's much important to me about my homework process.

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

    sir, i need MATLAB code for IEMD, can you please help , i can't find anywhere, it would be really helpful, i am a research scholar

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

      What is IEMD?

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

      @@CarlosMontalvo251 Image empirical mode decomposition, it's 2D empirical mode decomposition

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

      @@ashishsingh2911 Unfortunately I have never heard of that before.

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

      Ashish Singh that is why is called research, do your research!

  • @laraehabmoawad4126
    @laraehabmoawad4126 3 роки тому

    I can't find the code itself. Can you please send it here

    • @CarlosMontalvo251
      @CarlosMontalvo251  3 роки тому

      github.com/cmontalvo251/MATLAB/blob/master/Screen_Cast_Codes/Interpolation/cubicsplines.m

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

    Hello Dr. Montalvo,
    The link you provided for the Cubic spline code is not valid I think. I mean this one:
    gitlab.com/Montalvo/MATLAB_Games.git

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

      I apologize. I moved everything to github a while back. github.com/cmontalvo251/MATLAB