![]() ![]() I would really be glad if you can help me. K0 = -3 for cubic splines, and is not the same as for the intervals for B0, k0. for j = K0, K0+1,….K-1, I also would like to plot these translated version of B0(x). Where the other B-splines are translations of B0(x) given by:īJ(x) = B0(x-kj). The peremeter to be estimated is a sum given by: X = rand(1,N) and decomposed into an interval kx given: I am working on an estimation problem in wish I need to generate a plot of the following function ( a cubic spline K0 = -3): I have tried your code to some other similar functions like the one you have, and it works very well, except for the one that I have to do regarding my project. I highly appreciate the fact that you took your time to write such a nice program for graphing piecewise functions. You can leave a response, or trackback from your own site.Ĥ3 Responses to “Piecewise functions in matlab” You can follow any responses to this entry through the RSS 2.0 feed. This entry was posted on Tuesday, June 15th, 2010 at 4:00 pm and is filed under code. Note: The polynomial above is from Higher Order Barycentric Coordinates by Torsten Langer and Hans-Peter Seidel. ![]() But I think the presentation is very nice and is easily broken up if need be. I guess this method is somewhat risky in the sense that if you mess up your logicals or inequalities the addition could sum up erroneous values without recognizing the error. Multiplied against the value for the condition and added to the next gives the correct solution. This works because the conditions in matlab are now logicals that return a vector the same size as x, with 1’s if the condition was true and 0’s otherwise. Say you have the piecewise polynomial, m, defined as: Would you like to be able to specify a piecewise. But here’s a handy conversion from a math formula to matlab. The following Matlab project contains the source code and Matlab examples used for piecewise functions. Not the most difficult thing to do by any means. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |