我大概讲一下实现的原理:正弦波移相φ,当使得大于sin(φ)的值为1,其他值为-1,占空比就跟这个φ值之间有联系. 占空比原理图如下所示. 结果上图,可以实现调节占空比,方波频率,方波个数. 下面是函数的代码: function y=squarewav(Vm,f,K,n) %参数为幅度,频率,占空比,以及波形个数 % 正弦信号 % f = 1000;% 正弦波频率 w = 2*pi*f;% 正弦波角频率 % Vm = 2;% 正弦幅值 u = (0.5-K)*pi;% 相位 N = 4000;%
I am writing a python script from which I hope to call the Matlab anovan function. I have attempted a basic test of this feature on file test.txt. This file is imported as array data. In matlab, the anovan function would be called as follows: anovan(
function lorenzgui %LORENZGUI Plot the orbit around the Lorenz chaotic attractor. % This function animates the integration of the three coupled % nonlinear differential equations that define the Lorenz Attractor, % a chaotic system first described by
http://blogs.mathworks.com/loren/2007/03/01/creating-sparse-finite-element-matrices-in-matlab/ Loren on the Art of MATLAB March 1st, 2007 Creating Sparse Finite-Element Matrices in MATLAB I'm pleased to introduce Tim Davis as this week's guest blogge
Mathematics One-Dimensional Interpolation There are two kinds of one-dimensional interpolation in MATLAB: Polynomial interpolation FFT-based interpolation Polynomial Interpolation The function interp1 performs one-dimensional interpolation, an im
mvnrnd - Multivariate normal random numbers This MATLAB function returns an n-by-d matrix R of random vectors chosen from the multivariate normal distribution with mean MU, and covariance SIGMA. 假设n维, (1)R = mvnrnd(MU,SIGMA) 返回一个n维向量(2)r = mvnrnd(MU,