Saturday, November 21, 2009

m file to learn matlab

% m file to learn matlab
%nwe nwe htay
%Example 5.
%The following code generates sine and cosine curves,
%then samples the splines over a finer mesh.
%21 nov. 2009


x = 0:.25:1;
Y = [sin(x); cos(x)];
xx = 0:.1:1;
YY = spline(x,Y,xx);
plot(x,Y(1,:),'o',xx,YY(1,:),'-'); hold on;
plot(x,Y(2,:),'o',xx,YY(2,:),':'); hold off;

No comments: