From: matlaberboy on 3 Jun 2010 16:36 B-splines are zero outside their support, any function in B-form is zero outside the basic interval of its form. This is very much in contrast to a function in ppform whose values outside the basic interval of the form are given by the extension of its leftmost, respectively rightmost, polynomial piece. I have a pp form spline. When I evaluate that spline outside its boundaries the arformentioned behavior occurs. I would like to make fnval with pp behave like it does for B-splines. Can anyone help? I would have thought this sort of thing would have worked but it doesnt: function dataOut = fnval2(mySpline, dataIn) if(strcmpi(mySpline.form, 'pp')) myMin = min(mySpline.breaks); myMax = max(mySpline.breaks); idxMIN = find(dataIn < myMin); idxMAX = find(dataIn > myMax); dataOut = fnval(mySpline, dataIn); dataOut(idxMIN) = 0; dataOut(idxMAX) = 0; elseif(strcmpi(mySpline.form, 'B-') || strcmpi(mySpline.form, 'B')) dataOut = fnval(mySpline, dataIn); else error('Spline type not recognized') end end Thank You!!
From: matlaberboy on 5 Jun 2010 14:24 solved: doc fn2fm
|
Pages: 1 Prev: shade area between two curves Next: matlab subplots with different ranges |