matlab期末作业(matlab期末作业).docxmat lab期末作业(matlab期末作业)
The final assignments are as follows:
1. solving differential equations, drawing the solution COS
Two
3?
?
Two
The theoretical curves are compared and the corresponding curves are drawn.
Make a function first
Take 0, 0. 5, 1, . . . 9. 5, 10, take a value every 0. 5, and make a scatter plot.
T
E
T
T
Y
Two
3?
?
Secondly, the scatter points are linear (linear), three degree polynomial (cubic) and spline interpolation respectively.
T=0::10;
Y=t. ”3. *exp (-2*t).*cos (t):
Xl-0:. 25:10;
Yl=interpl (T, y, xl, ' liner,);
Plot (T, y, ' r*', xl, Yl,'b');
Legend (' scatter point' , ' linear interpolation');
Zero
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
-0. 1
-0. 08
-0. 06
-0. 04
-0. 02
Zero
Zero point zero two
Zero point zero six
Zero point zero eight
Scatter
linear interpolation
T=0:0. 5:10;
Y=t. ”3. *exp (-2*t).*cos (t):
X>0:. 25:10;
Yl=interpl (T, y, xl, ' cubic');
Plot (T, y, ' r*', xl, Yl,'b');
Legend ( scatter point ' , ' three polynomial interpolation ');
Three
Zero
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
-0. 1
-0. 08
-0. 06
-0. 04
-0. 02
Zero
Zero point zero two
Zero point zero four
Zero point zero six
Scatter point
Three polynomial interpolation
T=0:0. 5:10;
Y=t. ”3. *exp (-2*t).*cos (t):
X>0:. 25:10;
Yl=interpl (T, y, xl, ' spline');
Plot (T, y, ' r*', xl, Yl,'b');
Legend ( scatter ' , ' spline interpolation ');
Zero
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
-0. 1
-0. 08
-0. 06
-0. 04
-0. 02
Zero
Zero point zero
Zero point zero
Zero point zero
Zero point zero
two
four
six
eight
Scatter
Spline interpolation
Four
3 a factory produces two kinds of beverages, 6 kg per 100 boxes of beverage and 10 workers
Make a profit of 100 thousand yuan;
Every hundred boxes of B drinks need 5 kilograms of raw materials, 20 workers, 90 thousand yuan profit.
matlab期末作业(matlab期末作业) 来自淘豆网m.daumloan.com转载请标明出处.