MATLAB中几个比较有用的程序
程序一%function 画x(n)=K*exp(a+b*j)*n j 虚指数
% Edit time 2012/3/13
%
Editor 何飞
a=input('Type in real exponent=');%输入实部
b=input('Type in imaginary exponent');%输入虚部
c=a+b*i;
K=input('Type in the gain constant');%系数K
N=input('Type in length of sequence');%画图的长度
n=1:N;
x=K*exp(c*n);
subplot(121);
stem(n,real(x));%画实部
xlabel('n'); ylabel('Re(x)');
disp('Press return for imagimary part');
pause
subplot(122);
stem(n,imag(x));%画虚部
xlabel('n');ylabel('imag(x)');
disp('Press return for magnitude part');
pause
subplot(223);
stem(n,abs(x));%画幅频特性曲线
xlabel('n');ylabel('magnitude');
disp('Pr