MATLAB: Generate square wave starting from 0 square I want to make square wave with function square which starts from 0 and not with amplitude Best Answer [zeroes(1,M), ones(1,N)] repeated as necessary . Related SolutionsMATLAB: Sinewave generation:how generatea sine wave t=0:0.001:1; freq = 10; signal = sin( freq * 2 * pi * t); plot(t, signal); MATLAB: Square wave RESOLUTION = 1000; %whatever is appropriateDUTYCYCLE = 0.73; %e.g. 73% on, 27% offNUMBEROFCYCLES = 18; %as appropriatebasepulse = ones(1,RESOLUTION);squarepulse = basepulse;squarepulse(floor(DUTYCYCLE * RESOLUTION) + 1 : end) = 0;wavetrain = repmat(squarepulse, 1, NUMBEROFCYCLES); Related QuestionGenerating a square waveHow to create a half cosine waveHow to plot a square wave centered around the Y-axis in MATLABGenerating Square Wave in Matlab
Best Answer