10 days experience @ kyaukse computer university
dear aunty shwe zin u 1961,
i am now 10 days @ kyauk seဲ computer university(ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ).
i have to ride about 20 miles to the university;
sometimes ,if i do not get a seat, i have to stand the whole journey ;
i feel very exhausted when i got at my class room ;
buildings are very big and lovely.
we have a very grand convocation Hall.
but we do not have canteen in our university compound.
we do not have trees and flower gardens;
when i was in High School, i used to dream of beautiful flowers and big trees and beautiful lakes (like Inya lake);
i dream to walk around with my friends in beautiful flower gardens.
we have many teachers;
most of them are Ph.Ds!
we are very proud of them ;
but we are not very happy to wear university uniforms;
we want to wear trendy dress (especially jeans);
we are not allowed to do that; very bad? don't u think so?
dear aunty ,my grandfather and uncle u win said you are a good writer;
u read a lot;
but unfortunately u read cartoons!
please write ur stories on
my grandpa's site;
i am very eager to read ur stories.
with best wishes
ကြန္ျပူတာမ ယ္သစ္လြင္စုျငိမ္းျငိမ္းခ်မ္း
(ကြန္ျပ ူတာဖရက္ရွာစုျငိမ္းျငိမ္းခ်မ္း)
ုkyauk se university
sunyeinnyeinchan@gmail.com,
sunyeinnyeinchan@nolimitmail.com.
http://groups.google.com/group/cherryagrochemicals,
http://groups.google.com/group/Mandalay-University-Family-2006,
http://groups.google.com/group/Shwe/TimeWarpedGoldenLand,
http://groups.google.com/group/DefenceServicesTechnologicalFamily.
cherryagrochemicals@googlegroups.com,
Mandalay-University-Family-2006@googlegroups.com ,
Shwe/TimeWarpedGoldenLand@googlegroups.com,
DefenceServicesTechnologicalFamily@googlegroups.com .
http://sites.google.com/site/nyeinchan28/Home;
http://sites.google.com;
http://sites.google.com/site/mandalayuniversityfamily2009/home.
http://shwezinu.blogspot.com/2009_08_10_archive.html
Tuesday, November 24, 2009
Sunday, November 22, 2009
computer fresher sunyeinnyeinchan(ကြန္ျပ ူတာဖရက္ရွာစုျငိမ္းျငိမ္းခ်မ္း)
sunyeinnyeinchan@gmail.com,
sunyeinnyeinchan@nolimitmail.com.
from mandalay with love,
23 nov. 2009
dear u myo khin,
i am now 10 days @ kyau se computer university(ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ).
i have to ride about 20 miles to the university;sometimes ,if i do not get a seat, i have to stand the whole journey ; i feel very exhausted when i got at my class room ;
buildings are very big and lovely.
we have a very grand convocation Hall.
we do not have canteen in our university compound.
we do not have trees and flower gardens;
when i was in High School, i used to dream of beautiful flowers and big trees and beautiful lakes (like Inya lake); i dream to walk around with my friends in beautiful flower gardens.
we have many teachers; most of them are Ph.Ds.
we are very proud of them and to wear university uniforms;
dear u myo khin ,my grandfather said you are a good story teller.
please write ur story about
"pa oa robbers " ပအို ့ဒါးျပ ဇာတ္လမ္း on my grandpa's site;
i am very eager to read ur stories.
with best wishes
ကြန္ျပူတာမ ယ္သစ္လြင္စုျငိမ္းျငိမ္းခ်မ္း
(ကြန္ျပ ူတာဖရက္ရွာစုျငိမ္းျငိမ္းခ်မ္း)
ုkyauk se university
sunyeinnyeinchan@gmail.com,
sunyeinnyeinchan@nolimitmail.com.
http://groups.google.com/group/cherryagrochemicals,
http://groups.google.com/group/Mandalay-University-Family-2006,
http://groups.google.com/group/Shwe/TimeWarpedGoldenLand,
http://groups.google.com/group/DefenceServicesTechnologicalFamily.
cherryagrochemicals@googlegroups.com,
Mandalay-University-Family-2006@googlegroups.com ,
Shwe/TimeWarpedGoldenLand@googlegroups.com,
DefenceServicesTechnologicalFamily@googlegroups.com .
http://sites.google.com/site/nyeinchan28/Home;
http://sites.google.com;
http://sites.google.com/site/mandalayuniversityfamily2009/home.
http://shwezinu.blogspot.com/2009_08_10_archive.html
http://nyeinchansarpay.blogspot.com
sunyeinnyeinchan@nolimitmail.com.
from mandalay with love,
23 nov. 2009
dear u myo khin,
i am now 10 days @ kyau se computer university(ေက်ာက္ဆည္ ကြန္ျပ ူတာ ယူနီဗာစီတီ).
i have to ride about 20 miles to the university;sometimes ,if i do not get a seat, i have to stand the whole journey ; i feel very exhausted when i got at my class room ;
buildings are very big and lovely.
we have a very grand convocation Hall.
we do not have canteen in our university compound.
we do not have trees and flower gardens;
when i was in High School, i used to dream of beautiful flowers and big trees and beautiful lakes (like Inya lake); i dream to walk around with my friends in beautiful flower gardens.
we have many teachers; most of them are Ph.Ds.
we are very proud of them and to wear university uniforms;
dear u myo khin ,my grandfather said you are a good story teller.
please write ur story about
"pa oa robbers " ပအို ့ဒါးျပ ဇာတ္လမ္း on my grandpa's site;
i am very eager to read ur stories.
with best wishes
ကြန္ျပူတာမ ယ္သစ္လြင္စုျငိမ္းျငိမ္းခ်မ္း
(ကြန္ျပ ူတာဖရက္ရွာစုျငိမ္းျငိမ္းခ်မ္း)
ုkyauk se university
sunyeinnyeinchan@gmail.com,
sunyeinnyeinchan@nolimitmail.com.
http://groups.google.com/group/cherryagrochemicals,
http://groups.google.com/group/Mandalay-University-Family-2006,
http://groups.google.com/group/Shwe/TimeWarpedGoldenLand,
http://groups.google.com/group/DefenceServicesTechnologicalFamily.
cherryagrochemicals@googlegroups.com,
Mandalay-University-Family-2006@googlegroups.com ,
Shwe/TimeWarpedGoldenLand@googlegroups.com,
DefenceServicesTechnologicalFamily@googlegroups.com .
http://sites.google.com/site/nyeinchan28/Home;
http://sites.google.com;
http://sites.google.com/site/mandalayuniversityfamily2009/home.
http://shwezinu.blogspot.com/2009_08_10_archive.html
http://nyeinchansarpay.blogspot.com
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;
%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;
4 examples to learn data anaylysis
4 examples to learn data anaylysis
Nwe nwe htay
Saturday, November 21, 2009
MATLAB Function Reference spline
Cubic spline data interpolation
Syntax
pp = spline(x,Y)
yy = spline(x,Y,xx)
Description
pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.
yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].
Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)
Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.
Examples
Example 1. This generates a sine curve, then samples the spline over a finer mesh.
x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.
x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
Example 3. The two vectors
t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];
represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression
spline(t,p,2000)
uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060
Example 4. The statements
x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal
generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.
Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.
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;
Algorithm
A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.
See Also
interp1, ppval, mkpp, pchip, unmkpp
References
[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.
spinmap spones
© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks
Nwe nwe htay
Saturday, November 21, 2009
MATLAB Function Reference spline
Cubic spline data interpolation
Syntax
pp = spline(x,Y)
yy = spline(x,Y,xx)
Description
pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.
yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].
Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)
Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.
Examples
Example 1. This generates a sine curve, then samples the spline over a finer mesh.
x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.
x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
Example 3. The two vectors
t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];
represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression
spline(t,p,2000)
uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060
Example 4. The statements
x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal
generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.
Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.
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;
Algorithm
A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.
See Also
interp1, ppval, mkpp, pchip, unmkpp
References
[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.
spinmap spones
© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks
4 examples to learn data anaylysis
4 examples to learn data anaylysis
Nwe nwe htay
Saturday, November 21, 2009
MATLAB Function Reference spline
Cubic spline data interpolation
Syntax
pp = spline(x,Y)
yy = spline(x,Y,xx)
Description
pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.
yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].
Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)
Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.
Examples
Example 1. This generates a sine curve, then samples the spline over a finer mesh.
x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.
x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
Example 3. The two vectors
t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];
represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression
spline(t,p,2000)
uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060
Example 4. The statements
x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal
generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.
Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.
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;
Algorithm
A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.
See Also
interp1, ppval, mkpp, pchip, unmkpp
References
[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.
spinmap spones
© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks
Nwe nwe htay
Saturday, November 21, 2009
MATLAB Function Reference spline
Cubic spline data interpolation
Syntax
pp = spline(x,Y)
yy = spline(x,Y,xx)
Description
pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.
yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].
Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)
Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.
Examples
Example 1. This generates a sine curve, then samples the spline over a finer mesh.
x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.
x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
Example 3. The two vectors
t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];
represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression
spline(t,p,2000)
uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060
Example 4. The statements
x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal
generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.
Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.
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;
Algorithm
A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.
See Also
interp1, ppval, mkpp, pchip, unmkpp
References
[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.
spinmap spones
© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks
Cubic spline data analysis.
%this program is useful to learn matlab.
%nwe nwe htay learning matlab 11 no.2009
%5:53:34 AM
%load('K:\matlab.mat')
%Example 5. The following code generates sine and cosine curves,
%then samples the splines over a finer mesh.
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,:),'oY
0 0.2474 0.4794 0.6816 0.8415
1.0000 0.9689 0.8776 0.7317 0.5403
Y(1,:) %GENERATING 1 st. row.
%ans =
0 0.2474 0.4794 0.6816 0.8415
Y(:,5) %generting 5 th. column.
%ans =
% 0.8415
% 0.5403
Y %generating matrix y
%Y =
% 0 0.2474 0.4794 0.6816 0.8415
% 1.0000 0.9689 0.8776 0.7317 0.5403
Y(2,5) %element(2,5)
%ans =
% 0.5403
%Y(2,3)
%ans =
% 0.8776
%nwe nwe htay learning matlab 11 no.2009
%5:53:34 AM
%load('K:\matlab.mat')
%Example 5. The following code generates sine and cosine curves,
%then samples the splines over a finer mesh.
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,:),'oY
0 0.2474 0.4794 0.6816 0.8415
1.0000 0.9689 0.8776 0.7317 0.5403
Y(1,:) %GENERATING 1 st. row.
%ans =
0 0.2474 0.4794 0.6816 0.8415
Y(:,5) %generting 5 th. column.
%ans =
% 0.8415
% 0.5403
Y %generating matrix y
%Y =
% 0 0.2474 0.4794 0.6816 0.8415
% 1.0000 0.9689 0.8776 0.7317 0.5403
Y(2,5) %element(2,5)
%ans =
% 0.5403
%Y(2,3)
%ans =
% 0.8776
Cubic spline data interpolation
Nwe nwe htay
Saturday, November 21, 2009
MATLAB Function Reference spline
Cubic spline data interpolation
Syntax
pp = spline(x,Y)
yy = spline(x,Y,xx)
Description
pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.
yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].
Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)
Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.
Examples
Example 1. This generates a sine curve, then samples the spline over a finer mesh.
x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.
x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
Example 3. The two vectors
t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];
represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression
spline(t,p,2000)
uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060
Example 4. The statements
x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal
generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.
Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.
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;
Algorithm
A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.
See Also
interp1, ppval, mkpp, pchip, unmkpp
References
[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.
spinmap spones
© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks
Saturday, November 21, 2009
MATLAB Function Reference spline
Cubic spline data interpolation
Syntax
pp = spline(x,Y)
yy = spline(x,Y,xx)
Description
pp = spline(x,Y) returns the piecewise polynomial form of the cubic spline interpolant for later use with ppval and the spline utility unmkpp. x must be a vector. Y can be a scalar, a vector, or an array of any dimension, subject to the following conditions: If Y is a scalar or vector, it must have the same length as x. A scalar value for x or Y is expanded to have the same length as the other. See Exceptions (1) for an exception to this rule, in which the not-a-knot end conditions are used. If Y is an array that is not a vector, the size of Y must have the form [d1,d2,...,dk,n], where n is the length of x. The interpolation is performed for each d1-by-d2-by-...-dk value in Y. See Exceptions (2) for an exception to this rule.
yy = spline(x,Y,xx) is the same as yy = ppval(spline(x,Y),xx), thus providing, in yy, the values of the interpolant at xx. xx can be a scalar, a vector, or a multidimensional array.The sizes of xx and yy are related as follows: If Y is a scalar or vector, yy has the same size as xx. If Y is an array that is not a vector, If xx is a scalar or vector, size(yy) equals [d1, d2, ..., dk, length(xx)]. If xx is an array of size [m1,m2,...,mj], size(yy) equals [d1,d2,...,dk,m1,m2,...,mj].
Exceptions
If Y is a vector that contains two more values than x has entries, the first and last value in Y are used as the endslopes for the cubic spline. If Y is a vector, this means f(x) = Y(2:end-1) df(min(x)) = Y(1) df(max(x)) = Y(end) If Y is a matrix or an N-dimensional array with size(Y,N) equal to length(x)+2, the following hold: f(x(j)) matches the value Y(:,...,:,j+1) for j=1:length(x) Df(min(x)) matches Y(:,:,...:,1) Df(max(x)) matches Y(:,:,...:,end)
Note You can also perform spline interpolation using the interp1 function with the command interp1(x,y,xx,'spline'). Note that while spline performs interpolation on rows of an input matrix, interp1 performs interpolation on columns of an input matrix.
Examples
Example 1. This generates a sine curve, then samples the spline over a finer mesh.
x = 0:10;
y = sin(x);
xx = 0:.25:10;
yy = spline(x,y,xx);
plot(x,y,'o',xx,yy)
Example 2. This illustrates the use of clamped or complete spline interpolation where end slopes are prescribed. Zero slopes at the ends of an interpolant to the values of a certain distribution are enforced.
x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,[0 y 0]);
xx = linspace(-4,4,101);
plot(x,y,'o',xx,ppval(cs,xx),'-');
Example 3. The two vectors
t = 1900:10:1990;
p = [ 75.995 91.972 105.711 123.203 131.669 ...
150.697 179.323 203.212 226.505 249.633 ];
represent the census years from 1900 to 1990 and the corresponding United States population in millions of people. The expression
spline(t,p,2000)
uses the cubic spline to extrapolate and predict the population in the year 2000. The result is
ans =
270.6060
Example 4. The statements
x = pi*[0:.5:2];
y = [0 1 0 -1 0 1 0;
1 0 1 0 -1 0 1];
pp = spline(x,y);
yy = ppval(pp, linspace(0,2*pi,101));
plot(yy(1,:),yy(2,:),'-b',y(1,2:5),y(2,2:5),'or'), axis equal
generate the plot of a circle, with the five data points y(:,2),...,y(:,6) marked with o's. Note that this y contains two more values (i.e., two more columns) than does x, hence y(:,1) and y(:,end) are used as endslopes.
Example 5. The following code generates sine and cosine curves, then samples the splines over a finer mesh.
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;
Algorithm
A tridiagonal linear system (with, possibly, several right sides) is being solved for the information needed to describe the coefficients of the various cubic polynomials which make up the interpolating spline. spline uses the functions ppval, mkpp, and unmkpp. These routines form a small suite of functions for working with piecewise polynomials. For access to more advanced features, see the M-file help for these functions and the Spline Toolbox.
See Also
interp1, ppval, mkpp, pchip, unmkpp
References
[1] de Boor, C., A Practical Guide to Splines, Springer-Verlag, 1978.
spinmap spones
© 1994-2006 The MathWorks, Inc. • Terms of Use • Patents • Trademarks
Sunday, November 1, 2009
Subscribe to:
Posts (Atom)