Menu

[Solved]Please Solve Loop Needed M Difficulty Going Element Array Sigy Please Write Comments Under Q37138610

3. (30 points) Write a MATLAB function called clipSignal with the following form function tsigr clipl -clipsignal(aigx,sigt,cPlease solve with for loop and if if needed. I’m havingdifficulty in going through each element in array sigY. Pleasewrite comments so I can understand.3. (30 points) Write a MATLAB function called clipSignal with the following form function tsigr clipl -clipsignal(aigx,sigt,clipin,clipMax) end This function is used to “clip” a signal at a maximum and minimum amplitude (y-value). The function arguments are defined as follows: ·Input 1: sígx . Input 2: ig An array of x values of the original signal An array of y values (amplitude) of the original signal Input 3: cliMin The minimum amplitude that the clipped signal should have Input 4:lipax The maximum amplitude that the clipped signal should have Output1g elip An array of y values (amplitude) of the clipped signal Your function should do the following: 1. This function must use a FOR loop to go through each element of the array sigY and set the corresponding value of the array o the original value, o clipMin, oif the original value is smaller than clipMin) or o clipMax (if the original value is larger than clipMax) sigY clip to either Your function should also plot the original and clipped signals side by side as shown in the example run below. You must include the plot titles and gridlines 2. Example Run: Command Line ysin(x)i yclip ctipsignat.Y-9.8,0.5) Plot ou are not required to set the axis boundaries or line width Show transcribed image text 3. (30 points) Write a MATLAB function called clipSignal with the following form function tsigr clipl -clipsignal(aigx,sigt,clipin,clipMax) end This function is used to “clip” a signal at a maximum and minimum amplitude (y-value). The function arguments are defined as follows: ·Input 1: sígx . Input 2: ig An array of x values of the original signal An array of y values (amplitude) of the original signal Input 3: cliMin The minimum amplitude that the clipped signal should have Input 4:lipax The maximum amplitude that the clipped signal should have Output1g elip An array of y values (amplitude) of the clipped signal Your function should do the following: 1. This function must use a FOR loop to go through each element of the array sigY and set the corresponding value of the array o the original value, o clipMin, oif the original value is smaller than clipMin) or o clipMax (if the original value is larger than clipMax) sigY clip to either Your function should also plot the original and clipped signals side by side as shown in the example run below. You must include the plot titles and gridlines 2. Example Run: Command Line ysin(x)i yclip ctipsignat.Y-9.8,0.5) Plot ou are not required to set the axis boundaries or line width

Expert Answer


Answer to Please solve with for loop and if if needed. I’m having difficulty in going through each element in array sigY. Please… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *