i am trying to create trapezoidal wave form but it is not working. please help code: %% FIRST TRAPEZOIDAL WAVE FORM clc; clear all; imx=8; imn=2; T = 20; s1= @(x) (imx+imn).*(0<=x & x<=T/6) +(imx+imn*(2-6*x/T)).*(T/6<=x & x<=T/3)+(imx).*(T/3<=x & x<=2*T/3)+(imx+imn(6*x/T-4)).*(2*T/3<=x & x<=5*T/6); x = linspace(0, 20); I1 = s1(x); figure(1) plot(x,I1) %% SECOND TRAPEZOIDAL WAVE FORM clc; clear all; imx=8; imn=2; T = 20; s2= @(x) (imx+imn*(6*x/T)).*(0<=x & x<=T/6) +(imx+imn).*(T/6<=x & x<=T/2)+(imx+imn*(4-6*x/T)).*(T/2<=x & x<=2*T/3)+(imx).*(2*T/3<=x & x<=T); x = linspace(0,20); I2 = s2(x); figure(1) plot(x,I2) %% % THIRD TRAPEZOIDAL WAVE FORM clc; clear all; imx=8; imn=2; T = 20; s3= @(x) (imx).*(0<=x & x<=T/3) +(imx+imn*(6*x/T-2)).*(T/3<=x & x<=T/2)+(imx+imn).*(T/2<=x & x<=5*T/6)+(imx+imn(6-6*x/t)).*(5*T/6<=x & x<=T); x = linspace(0,20); I3 = s3(x); figure(1) plot(x,I3) please find attachment
MATLAB: Why am i getting error in making trapezoidal wave form
digital image processingdigital signal processinggraphimage processingmathematicsmatlab codermatrix manipulationprogrammingsignal processing
Related Question
- How to write equation in matlab ?
- How to write code for 2D image using code for one dimensional plot given below
- How to convert a wave form into 2D matrix form using for loop
- Simplify expression after collect function
- How to write equation given below to find corresponding plot
- What is wrong with the code
Best Answer