Worksheet22201文档格式.docx
- 文档编号:19092692
- 上传时间:2023-01-03
- 格式:DOCX
- 页数:34
- 大小:299.67KB
Worksheet22201文档格式.docx
《Worksheet22201文档格式.docx》由会员分享,可在线阅读,更多相关《Worksheet22201文档格式.docx(34页珍藏版)》请在冰豆网上搜索。
xlabel('
t'
),ylabel('
v1'
title('
Graphofv_1=cos(10*pi*t)'
v_2=cos(10*pi*t).*exp(-5*t);
subplot(2,2,2);
plot(t,v_2);
v2'
Graphofv_2=cos(10*pi*t).*exp(-5*t)'
v_3=cos(10*pi*t).*exp(-10*t);
subplot(2,2,3);
plot(t,v_3);
v3'
Graphofv_3=cos(10*pi*t).*exp(-10*t)'
v_4=cos(10*pi*t).*exp(-20*t);
subplot(2,2,4);
plot(t,v_4);
v4'
Graphofv_4=cos(10*pi*t).*exp(-20*t)'
4.Useplot3toplot2spiralcurveslikebelowwithappropriatelinewidthandcolour.
10;
z=0.2*t;
x=sin(2*pi.*t).*z.*z;
y=cos(2*pi.*t).*z.*z;
plot3(x,y,z,'
g'
'
LineWidth'
2);
holdon;
axis([-44-4402]);
holdoff;
z1=z.^0.5
x1=sin(2*pi.*t).*(z1)
y1=cos(2*pi.*t).*(z1)
plot3(x1,y1,z1,'
r'
5.Displaythesurfaceusingmeshandcontourwithasuitableresolution:
[x,y]=meshgrid(-2:
.1:
2,-2:
.2:
2);
f=exp(-0.005.*((x-50).^2+(y-50).^2));
figure
(1);
mesh(x,y,f);
x'
);
ylabel('
y'
grid;
figure
(2);
contour(x,y,f);
grid;
6.Load2ofyourphotosintoMatlabWorkSpaceusingimread.a)Changebrightnesslocallyorglobally.b)Overlapthemtoproduceanewphoto.c)writeanewphotointoafileusingimwrite.(Note:
lowerversionofMatlabsuchas6.5isnotallowedtodosomedirectimageoperations.)
ANSWER:
A=imread('
11.jpg'
B=imread('
22.jpg'
[MNP]=size(A);
imshow(A+100);
figure
(1);
C=A+B(1:
M,1:
N,1:
P);
imshow(C);
figure
(2);
imwrite(C,'
33.jpg'
7.
theequationcoefficients:
A=[1-143
-545-6
07-89
-13-26];
(M=N)
a)FindthedeterminantofA,
b)FindtheinverseofAandcheckformatrixsingularity,
c)IfB=[5;
1;
-2;
3],findtheunknownxintheequation.
a)det(A)
ans=
-765.0000
b)inv(A)
0.3333-0.00000.3333-0.6667
0.20000.11760.2706-0.3882
0.20000.05880.0353-0.0941
0.0222-0.0392-0.06800.2183
cond(A)
16.4186
c)x=inv(A)*b
-1.0000
-0.5882
0.7059
0.8627
8.Forlinearsimultaneousequations,
M>
N,theequationcoefficients:
-13-26
1-253
147-3];
a)FindthedeterminantofA’*A,
b)FindtheinverseofA’*Aandcheckformatrixsingularity,
3;
4;
0],findthesolutionoftheequation.
a)det(A'
*A)
2.1051e+07
b)inv(A'
0.08840.0321-0.0013-0.0219
0.03210.02310.0002-0.0099
-0.00130.00020.00850.0053
-0.0219-0.00990.00530.0144
cond(A'
32.5278
c)x=inv(A'
*A)*A'
*B
x=
-0.8903
-0.4898
0.5755
0.7083
9.Dataof10recordsareshownbelow
y=[3.54.33.75.46.67.38.78.89.49.010.012.011.39.913.3],
Usepolyfitwithdifferentorders(from1to3)ofpolynomialstofindacurveofbestfit.Checkthetotaldistancebetweenthefittedcurvezandrecordsdefinedby
.
x=linspace(0,1,15);
y=[3.54.33.75.46.67.38.78.89.49.010.012.011.39.913.3];
plot(x,y,'
p=polyfit(x,y,1);
z=polyval(p,x);
s1=sqrt(sum((z-y).^2));
%totaldistance
plot(x,z,'
b'
3);
%一次拟合
p=polyfit(x,y,2);
s2=sqrt(sum((z-y).^2));
%totaldistance
%二次拟合
p=polyfit(x,y,3);
s3=sqrt(sum((z-y).^2));
%三次拟合
gridon;
s1=
3.2807
s2=
3.0399
s3=
3.0398
10.Createasetof20pointsfromacurvebyMatlabcode:
x=1:
20;
y=2*exp(-0.3*(x-5).^2)+0.7*exp(-0.2*(x-12).^2);
Theninterpolatethecurveto60pointsusing‘linear’and‘spline’options,respectively.Seethequalityofdifferenttypesofinterpolation.
xi=1:
0.25:
yi=interp1(x,y,xi,'
linear'
plot(x,y,'
r*'
holdon;
plot(xi,yi,'
o'
:
'
holdoff;
spline'
PartB
1.Usingtheplotandsubplotfunctionscreate4plotsona2by2arrayofsubplots,forthefunctionexp(-t)sin(5t)showingineachplotthefunctioninthecorrespondingintervalsofti.e.(-2,-1),(-1,0),(0,1)and(1,2).
Answer:
t=-2:
.01:
2;
x=exp(-t).*sin(5.*t);
subplot(2,2,1);
plot(t,x);
axis([-2,-1-2020]);
subplot(2,2,2);
axis([-1,0-2020]);
subplot(2,2,3);
axis([0,1-2020]);
subplot(2,2,4);
axis([1,2-2020]);
2.Athreephaseinductionmotorcharacteristicisgivenintermsofmechanicalshaftoutputtorque
(NMNewton-meter)asafunctionofrotationalspeedω(rad/sradianpersecond).Thisisapproximatedby3piece-wiselinearequationsasfollows:
Thismotorisdirectlycoupledtoaload
whichcanberepresentedas
Write2separateMatlabfunctionm-filesinwhich:
a)themotorcharacteristic,b)theloadcharacteristicaredefinedonlyasfunctionsofω.Namethemmotor.mandsysload.m,respectively.
w=0:
0.01:
120*pi;
a)Tm=(w>
=0&
w<
=90*pi).*w*(90*pi)+4+(w<
=110*pi&
w>
90*pi).*(-10*w/(pi)+1200)+(w>
110*pi&
=120*pi).*(-10*w/(pi)+1200);
plot(w,Tm);
b)Tl=-50*(w/(120*pi)).^3+100*(w/(120*pi)).^2+4*w./(120*pi);
3.WriteaMatlabscripgt-mfilewhichcallsyourfunctionm-filesfromQuestion2.Andplotthemotorandloadcharactersticsonthesamefigure,givingsuitablelabellingandtitle.Namethisscriptm-filesystemplot.m
w=0:
pi/20:
plot(w,Tm,'
m'
hold
on;
plot(w,Tl,'
off;
speed
w(rad/s_)'
torque(NM
Newton-meter)'
the
motor
and
load
characterstics'
line'
sysload
4.Writeasriptm-filewhichfindsallthemathematicallpossiblepoints(valuesofω)where
5.
fortherange0≤ω≤120π(rad/s)withthecharacteristicgiveninQuestion2.Thesystemcouldtheoreticallyoperateataspeedωwhere
Mathematically,thisinvolvesfindingtherootsoftheequation
Giveanametothism-fileposspoints.m.Callposspoints.minsystemplot.mandshowallofthepointsonasystemplotusingthe‘o’symbol.
function[Tm]=tm(w)
Tm=(w>
end;
Function[T1]=t1(w)
Tl=-50*(w/(120*pi)).^3+100*(w/(120*pi)).^2+4*w./(120*pi);
end
(2)x
(1)=fzero(@tm,[60,90]);
x
(2)=fzero(@tm,[300,320]);
x(3)=fzero(@tm,[350,370]);
(3)w=0:
Tm=tm(w);
Tl=t1(w);
)
posspoints;
Tl=-50*(x/(120*pi)).^3+100*(x/(120*pi)).^2+4*x/(120*pi)
plot(x,Tl,'
ko'
grid
PartC
IntroductiontoDSP
1.Basicdigitalsignals
Unitimpulsefunction
Exercise1-1:
DisplaytheunitimpulsefunctionwithMatlabcode.ThecodecanbeeithertypedunderMatlabpromptorwrittenintoascriptMatlabfile,thenrunthefile.
n=-10:
fork=1:
21
x(k)=0;
x(11)=1;
stem(n,x);
axis([-101002]);
Problem1-1:
Forthesignal
writetheMatlabcodeandcopytheresultfigureintothefollowingboxes.
x(9)=2;
Unitstepfunction
Exercise1-2:
DisplaytheunitstepfunctionwithMatlabcode:
10
fork=11:
x(k)=1;
Problem1-2:
writetheMatlabcode,anddisplaythecorrespondingsignalintothefollowingboxes.
12
fork=13:
x(k)=-1;
axis([-1010-21]);
Sinewave
where-frequency(rad/second),T-samplinginterval(seconds)
Exercise1-3:
LetT=0.02,=6.28.Usingthefollowingcode,plotonthescreenintheregion0n100.
n=0:
100;
T=0.02;
omega=6.28;
101
x(k)=sin((k-1)*omega*T);
Problem1-3:
Modifytheabovecodetodisplaythesignal:
whereT=0.02,=6.28.Executethecodeandplotthesignalonthescreen.Copythecode,thendisplaythesignalintothefollowingboxes.
x(k)=2*sin((k-1)*omega*T+pi/2);
Timeshift,impulseandstepresponses
Exercise1-4
Fortheunitimpulse,
andtheunitstep
writetwoMatlabfunctionsands
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Worksheet22201
![提示](https://static.bdocx.com/images/bang_tan.gif)