📄 exmp2_1.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% exmp2_1.m - Code for generate, plot, and save sinewave
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A = 2.0; % amplitude of sinewave
w0 = 0.2*pi; % frequency of sinewave
N = 128; % length of sinewave
n = [0:N-1]; % time index
sn = A*sin(w0*n); % sine function defined in (2.2.6)
save sn.dat sn -ASCII;% save the sequence in ASCII file
% sn.dat for later use
plot(n,sn) % plot the sinewave
axis([0, 127, -inf, inf])
title('Sinewave'); % title of figure
xlabel('Time index, n'); ylabel('Amplitude');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -