MATLAB: Can i know the way to code the square wave in Matlab square wavesquarewave can i know the way to code the square wave in Matlab? the square wave that i need to solve just like in the picture Best Answer You can use square function http://www.mathworks.com/help/signal/ref/square.htmlt=0:0.01:20;y=square(t,50),plot(t,y) Related SolutionsMATLAB: Matlab code for square wave generation from fourier series (symsum fails for upperlimit greater than 1000 in the case) Hi, The function 'symsum' is trying to find a closed form expression as an answer and it is unable to do so.Instead, as a workaround, use ‘sum’ function to solve the equation. The usage in your example would be,An=sum(subs(an.*cos(n*w0*t),n,1:10000));Bn=sum(subs(bn.*sin(n*w0*t),n,1:10000)); MATLAB: When I integrate a constant over Tp I should get the constant but I don’t Hi,int is a Symbolic Toolbox function. Use either double or integral for direct numeric computation.a0 = double((1/T)*int(100.0,t,0,T)) Related QuestionI need help with an error “Undefined function or variable ‘x'”How can i perform a Fourier series on this functionReference index in equationHow to implement Fourier series.Error when trying to set A(n) = sqrt(a(n).^2+b(n).^2);
Best Answer