Comments on: Piecewise linear curve fitting https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/?s_tid=feedtopost Stuart uses video to share his experiences solving problems with MATLAB day-to-day, interesting new features, plus tips and tricks he has picked up along the way. Tue, 29 Aug 2017 19:06:01 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Ahmad R https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-76943 Tue, 29 Aug 2017 19:06:01 +0000 https://blogs.mathworks.com/videos/?p=624#comment-76943 Oops! I should correct my previous comment:

Here, we can freely define interior knots:
slmengine(x,y,’degree’,1,’knots’,4, ‘interiorknots’,’free’,’plot’,’on’);

Now I would say it’s a great piece of code!

]]>
By: Ahmad R https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-76942 Tue, 29 Aug 2017 18:52:53 +0000 https://blogs.mathworks.com/videos/?p=624#comment-76942 It is a nice code however it seems that it uses equally spaced “knot”‘s locations which is not ideal for many cases.

]]>
By: Stuart McGarrity https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-76774 Thu, 06 Jul 2017 16:06:18 +0000 https://blogs.mathworks.com/videos/?p=624#comment-76774 Hi Cheng, I’m afraid Doug Hull, the original author of this post has left the company. Do the default knot locations not work for you?

]]>
By: Cheng https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-76745 Fri, 30 Jun 2017 06:40:28 +0000 https://blogs.mathworks.com/videos/?p=624#comment-76745 Hi there, in your example, how did you decide the number and the position of “knots” of your fitting curve?

]]>
By: Doug https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-3877 Thu, 01 Nov 2012 18:35:11 +0000 https://blogs.mathworks.com/videos/?p=624#comment-3877 Check with the original author. I am only promoting it.

]]>
By: Kevin https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-3735 Fri, 26 Oct 2012 22:45:46 +0000 https://blogs.mathworks.com/videos/?p=624#comment-3735 Hi Doug, great code. I was wondering if there was a way to specify a range for the interior knots. For example, if I have x-axis data ranging in value from 0 to 10, and I want 4 knots, the first at 0, the last at 10, and the middle 2 at or between 4 and 8. Is there a way to make this happen using your slm toolbox? The ‘interior knots’ just puts the knots at any number great than 0 or less than 10, I believe. Thanks!

]]>
By: doug https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-3170 Mon, 13 Aug 2012 13:21:48 +0000 https://blogs.mathworks.com/videos/?p=624#comment-3170 @Petman,

It is in the econometrics toolbox.

]]>
By: Peyman https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-3167 Fri, 10 Aug 2012 15:01:38 +0000 https://blogs.mathworks.com/videos/?p=624#comment-3167 MATLAB R2012a didn’t find “hpfilter” in help !!!

]]>
By: Doug https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-3057 Wed, 18 Apr 2012 15:27:12 +0000 https://blogs.mathworks.com/videos/?p=624#comment-3057 @Henry, James

The link to the code is in the first paragraph of the post.

https://www.mathworks.com/matlabcentral/fileexchange/24443-slm-shape-language-modeling

I have confirmed it works.

Doug

]]>
By: James https://blogs.mathworks.com/videos/2012/03/02/piecewise-linear-curve-fitting/#comment-3056 Wed, 18 Apr 2012 10:50:16 +0000 https://blogs.mathworks.com/videos/?p=624#comment-3056 Yeah, code would have been nice – how can I learn this without an example to display some metacognitiion? Not trying to complain, but kind of lame.

]]>