This commit is contained in:
2025-11-17 11:16:02 +08:00
parent 4bd2d87fc4
commit 1b3b07a7f6
35 changed files with 454 additions and 0 deletions

8
lab3/exercise3_1.m Normal file
View File

@@ -0,0 +1,8 @@
%
A=[3,4,-7,-12;5,-7,4,2;1,0,8,-5;-6,5,-2,10];
B=[4;-3;9;-8];
%
rank(A)
%
C = A\B

6
lab3/exercise3_2.m Normal file
View File

@@ -0,0 +1,6 @@
% 3
x=-10:1:10;
y=-10:1:10;
[X,Y]=meshgrid(x,y);
Z=sin(sqrt(X.^2+Y.^2))./(sqrt(X.^2+Y.^2));
surf(X,Y,Z)

7
lab3/exercise3_3.m Normal file
View File

@@ -0,0 +1,7 @@
num=[1];
den=[1 2 2 1];
sys=tf(num,den);
figure(1); pzmap(sys); title('');
figure(2); impulse(sys);
w=0:0.1:10*pi;
figure(3); freqs(num,den,w)

10
lab3/exercise3_4.m Normal file
View File

@@ -0,0 +1,10 @@
subplot(2,2,2);
x=-pi/2:pi/10:pi/2;
y=sqrt(cos(x));
plot(x,y);
subplot(2,2,3);
x=-2:0.1:2;
y=-4:0.1:4;
[x,y]=meshgrid(x,y);
z=x.^2/4+y.^2/16;
surf(x,y,z)

42
lab3/lab3.m Normal file
View File

@@ -0,0 +1,42 @@
% 3
%
[filename1,p1]=uigetfile('*.txt', '');
fp=fopen(strcat(p1,filename1),'r');
i=1;bss=[];
while ~feof(fp)
line=fgetl(fp);
data=findstr(line,',');
bss(i).dh=line(1:data(1)-1);
bss(i).x=str2num(line(data(1)+1:data(2)-1));
bss(i).y=str2num(line(data(2)+1:data(3)-1));
bss(i).h=str2num(line(data(3)+1:data(4)-1));
bss(i).dm=line(data(4)+1:end);
i=i+1;
end
fclose(fp);
%
a=3976223.453;b=39512553.524;rad=deg2rad(0.433267);
c=cos(rad);d=-sin(rad);lmd=1.000034336;
m=i-1;gjzb=[];
for i=1:m
gjzb(i).dh=bss(i).dh;
gjzb(i).dm=bss(i).dm;
gjzb(i).h=bss(i).h;
gjzb(i).x=a+lmd*(c*bss(i).x-d*bss(i).y);
gjzb(i).y=b+lmd*(d*bss(i).x+c*bss(i).y);
end
%
[filename2,p2]=uigetfile('*.txt', '');
fn=fopen(strcat(p2,filename2),'w');
fprintf(fn,'%s\n\n',' X(m) Y(m) H(mm) code');
fclose(fp);fn=fopen(strcat(p2,filename2),'a');
for i=1:m
fprintf(fn,'%8s', gjzb(i).dh);
fprintf(fn,'%15.3f', gjzb(i).x);
fprintf(fn,'%16.3f', gjzb(i).y);
fprintf(fn,'%10.3f', gjzb(i).h);
fprintf(fn,'%8s\n', strcat(' ',gjzb(i).dm));
end
fclose(fn);

7
lab3/nikon.txt Normal file
View File

@@ -0,0 +1,7 @@
3,49510.3110,80362.3190,405.8240,s50
63,49488.9080,80426.0080,408.8490,S77
164,49461.2960,80462.3610,408.9950,S77
165,49457.2500,80485.8770,409.4490,S81
166,49476.6650,80395.8870,408.1090,S66
167,49475.1380,80398.7300,408.1570,S77
298,49465.2360,80593.9700,415.1290,S99

9
lab3/zhuanhuan.txt Normal file
View File

@@ -0,0 +1,9 @@
点名 X(m) Y(m) H(mm) code
3 4026749.416 39592285.024 405.824 s50
63 4026728.820 39592348.981 408.849 S77
164 4026701.670 39592385.683 408.995 S77
165 4026697.922 39592409.249 409.449 S81
166 4026716.196 39592319.017 408.109 S66
167 4026714.706 39592321.879 408.157 S77
298 4026707.277 39592517.236 415.129 S99