From: J Mathgeek on
Is there a way to get the slm output
(slm = slmengine(X,Y,'knots',0:.1:1,'xyp',[Xint',Yprime']); )
on the same form as pp (pp = spline(X,Y) ) ?


"John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hu6js0$q1q$1(a)fred.mathworks.com>...
> "J Mathgeek" <jmathgeek(a)gmail.com> wrote in message <hu5n06$dbi$1(a)fred.mathworks.com>...
> > We've got a spline problem:
> >
> > A cable is represented by a number of fixed points.
> > In the middle between each of these points we know the
> > direction of the cable (a "compass direction measurement").
> >
> > The cable is being represented by a cubic spline through the fixed points.
> > However, we also need to utilize the direction information.
> > I wonder if it is possible to use a derivative constraint or something?
> > Or, if the SLM - Shape Language Modeling could do this:
> > http://www.mathworks.com/matlabcentral/fileexchange/24443-slm-shape-language-modeling
> >
>
> SLM will do it easily enough, as long as you have the
> optimization toolbox.
>
> Your compass direction is just a slope, or at least you
> can turn it into one.
>
> Make sure you have enough knots, otherwise it will not
> be an exact fitting spline. A knot at each listed point,
> plus an additional knot at the intermediate points will
> give you an exact solution.
>
> For example, here is such a spline, fit to an exponential
> function, where the intermediate values are given as
> slopes.
>
> X = 0:.2:1;
> Y = exp(X/2);
> Xint = 0.1:0.2:0.9;
> Yprime = .5*exp(Xint/2);
>
> slm = slmengine(X,Y,'knots',0:.1:1,'xyp',[Xint',Yprime']);
> plotslm(slm)
>
> I guess you will need to take my word for it that the
> curve fits very nicely, and goes through the points
> as provided. Or you can try the above example for
> yourself.
>
> HTH,
> John
From: J Mathgeek on
Which toolboxes are needed to run the line
pp = BSFK(X,Y,[],[],[],struct('Animation',1,'pntcon',slope)); ?

I've only got Optimization Toolbox.

And, will pp be on the same form as pp = spline(X,Y) ?


Jan


"Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hu6km8$kqg$1(a)fred.mathworks.com>...
> Same example as John, but using the other package: ;-)
>
> X = 0:.2:1;
> Y = exp(X/2);
>
> Xint = 0.1:0.2:0.9;
> Yprime = .5*exp(Xint/2);
>
> slope = struct('p',1,'x',Xint,'v',Yprime);
> pp = BSFK(X,Y,[],[],[],struct('Animation',1,'pntcon',slope))
>
> % Bruno
From: John D'Errico on
"J Mathgeek" <jmathgeek(a)gmail.com> wrote in message <hv51km$sfp$1(a)fred.mathworks.com>...
> Is there a way to get the slm output
> (slm = slmengine(X,Y,'knots',0:.1:1,'xyp',[Xint',Yprime']); )
> on the same form as pp (pp = spline(X,Y) ) ?
>

Yes. Read the help for these tools. You will find the
'result' property if you did do so.

pp = slmengine(X,Y,'knots',0:.1:1,'xyp',[Xint',Yprime'],'result','pp');

John
From: Bruno Luong on
"J Mathgeek" <jmathgeek(a)gmail.com> wrote in message <hv51qv$b2m$1(a)fred.mathworks.com>...
> Which toolboxes are needed to run the line
> pp = BSFK(X,Y,[],[],[],struct('Animation',1,'pntcon',slope)); ?
>
> I've only got Optimization Toolbox.

Optimization Toolbox, or QPC engine that you can download elsewhere, as John said, read the help.

>
> And, will pp be on the same form as pp = spline(X,Y) ?

Yes.

Bruno