📄 examp11.m
字号:
clc,echo on
%EXAMPLE 11
n=0:15; % DT index
x=uramp(n)-uramp(n-5)-5*uramp(n-10); % Generate x[n]
e=sum(x.*x) % Energy in x[n]
dtplot(n,x,'o'),pause(2) % Plot x[n] using dtplot
xd=uramp(n-2)-uramp(n-7)-5*uramp(n-12); % Generate x[n-2]
stem(n,xd),pause(2) % Plot x[n-2] using stem
[xe,xo,nn]=evenodd(x,n); % Even, odd parts and index nn
dtplot(nn,xe,'o'),pause(2) % Plot even part of x[n]
dtplot(nn,xo,'o'),pause(2) % Plot odd part of x[n]
y=perext(x,7); % Periodic extension xpe[n]
np=0:20;dtplot(np,[y y y],'o') % Plot 3 periods over n=0:20
pwr=sum(y.*y)/7 % Power in xpe[n]
echo off %end of example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -