Download - 高等数学实验 MATLAB 实现

Transcript
Matlab
3.“Open Selection” M
4.“Run Script”
5.“Load Workspace”
7.“Show Workspace”
©2006-2007,
9. “Show GUI Layout Tool”
10. “Set Path”
Short 0.3333
Long 0.33333333333333
Hex 3fd5555555555555
Bank 0.33
(12) save name x y x y name.mat
(13) load name ‘name’
(14) load name x y ‘name’x y
(15) diary name1.m name1.m
… diary off
MATLABMATLAB4MATLAB
1919
©2006-2007,
1.   
2. 
x=[2,3]y=[4,5]z1=x+y, z2=x’*y
z1 = 6 8
1.  
7*x^3+8*x^2-3*x+35

A= 1 5 2
3 6 4
A=[1 5 2;3 6 4;6 8 9] 6 8 9
a1=A’ a1= 1 3 6
a2=det(A) 5 6 8
2 4 9
b=[12;6;10]
.: File/New/M-file,()edit
©2006-2007,
2. :
©2006-2007,
else y=5*x^2;
end
y
else y=1

end
2.:

©2006-2007,
c = 1 3 5 7 9
©2006-2007,
d =
0 0.6981 1.3963 2.0944 2.7925 3.4907 4.1888
Columns 8 through 10
a=
©2006-2007,
abcross (a,b) ()
a·b a×b ;
ab
b=[1 2 –1]; 2. A3=dot(-2*a,3*b)
A4=cross(a,2*b)

f = ‘ x^2+sin(x)^2-8 ’ %:
x=2*pi %
isstr(f ) %: f 1,f0
©2006-2007,
m
1 lcm
function c = lcm(a,b)
% LCM(A,B) is the least common multiple of corresponding elements of
if any(round(a(:)) ~= a(:) | round(b(:)) ~= b(:) | a(:) < 1 | b(:) < 1)
error('Input arguments must contain positive integers.');
end
©2006-2007,
r +
g *
b -
w :
k -.
Y=sin(x) x[-2,2 ] (*)

Y=x.^2; Y= sin(x);
plot(x,y) plot(x,y,’r*’)
y=ex+20 x [0,5] ()
z=2x3+3x+1 x [0,5] (*)
w=100cos(x) x [0,5] (+)

z=2*x^3+3*x+1; ylabel(‘y’)
w=100*cos(x); plot(x,y,x,z,’r*’,x,w,’m+’)
©2006-2007,
y2=2x4 x [0,2] (*)
y3=4*cos(x) x [0,2] (+)
y4=sin(x) x [0,2] (o)

f=sin(x)
1 fplot(f,[a,b])
: syms x t hold on y1=‘x^1’ ezplot(y3,[-1,1])
y2=‘x^2’ hold on
y3=‘x^3’ ezplot(y4,[-1,1])
ezplot(y1,[-1,1])
syms x
surf(x,y,z);
title('');
z=sin(r)./r;
©2006-2007,
©2006-2007,
3.: x=2*pi
limit (f,x,a)
©2006-2007,
diff(f,a) x^3
diff(f,a,2) 0
y3=(arctan(x/2))2 y’’’
y4=lncos(1/x) y(4)
z2=diff(‘(sin(x))^2*sin(x^2)’,2)
z3=diff(‘(arctan(x/2))^2’,3)
: x=05.
taylor(f,x,5)
: 1+1*x+1/2*x^2+1/6*x^3+1/24*x^4
©2006-2007,
f=‘exp(x)+2*cos(x)’
: f = x3 - x2 - x + 1 (-2 ,2 ).
:
x1=fminbnd( f ,-2,2)
x=x1 minf = eval(f)
x=x2 maxf = eval(f)
©2006-2007,
int (f) x sin(x)-x*cos(x)*c
int (f,c) c 1/2*c^2*x*sin(x)
int (f,0,2*pi) x(0,2pi) -2*pi*c
©2006-2007,
©2006-2007,