懒得分了,反正就这样

This commit is contained in:
iridiumR 2022-04-26 14:51:03 +08:00
parent 1faf39cfce
commit 19fb32a826
81 changed files with 57 additions and 35 deletions

55
Matlab/lab1.m Normal file
View file

@ -0,0 +1,55 @@
figure(1);
syms x;
t=-5:0.0001:5;
fx=heaviside(x+2)-heaviside(x-2);
ezplot(fx,[-5,5]);
figure(2);
fy=heaviside(x+0.2)-heaviside(x-0.2);
ezplot(fy,[-5,5]);
figure(3);
fz=heaviside(x+0.1)-heaviside(x-0.1);
ezplot(fz,[-5,5]);
figure(4);
subplot(2,1,1);
fa=5*cos(12*pi*t)+6*cos(18*pi*t);
plot(t,fa);
subplot(2,1,2);
xcorr1=autocorr(fa,t);
plot(corr1);
figure(5);
fb=(cos(2*pi*t)).*(cos(2*pi*t));
plot(t,fb);
figure(6);
t = 0:0.1:10;
b1=[1,5,6];
a1=[1,5];
sys=tf(a1,b1);
y1=step(sys,t);
a2=[1,5];
b2=[1,2,5];
sys=tf(a2,b2);
y2=step(sys,t);
a3=[1.5];
b3=[1,2,1];
sys=tf(a3,b3);
y3=step(sys,t);
plot(t,y1,t,y2,'--',t,y3,'+');
figure(7);
sys=tf([1,2],[1,3,2]);
y=impulse(sys,t);
plot(t,y);
f=cos(t);
sys=tf([-1,2],[1,3,2]);
y=lsim(sys,f,t);
plot(t,f);

View file

@ -119,41 +119,8 @@ void MainWindow::keyPressEvent(QKeyEvent *event) {
case Qt::Key_7:
emit ui->digitBtn7->clicked();
break;
case Qt::Key_8:
emit ui->digitBtn8->clicked();
break;
case Qt::Key_9:
emit ui->digitBtn9->clicked();
break;
case Qt::Key_Plus:
emit ui->addBtn->clicked();
break;
case Qt::Key_Minus:
emit ui->subtractionBtn->clicked();
break;
case Qt::Key_Asterisk:
emit ui->mulBtn->clicked();
break;
case Qt::Key_Slash:
emit ui->divisionBtn->clicked();
break;
case Qt::Key_Period:
emit ui->pointBtn->clicked();
break;
case Qt::Key_Equal:
emit ui->equalBtn->clicked();
case Qt::Key_Backspace:
emit ui->clearBtn->clicked();
break;
case Qt::Key_Delete:
emit ui->clearAllBtn->clicked();
break;
case Qt::Key_Enter:
emit ui->equalBtn->clicked();
break;
case Qt::Key_Escape:
emit ui->clearAllBtn->clicked();
break;
case Qt::Key_8:
default:
break;
}