Question: **In MATLAB** Create a script file for the sign function: Function y = sign_fun(x) Inputs: x = vector of any size Outputs: y = vector

**In MATLAB**

Create a script file for the sign function:

Function y = sign_fun(x)

Inputs: x = vector of any size

Outputs: y = vector with sgn(x) values

(a) Use your function to plot the sign function for 1001 values between -5 and 6.

(b) Compare the output y1 of your function with the output y2 built-in sign(x) by computing the maximum absolute error: max| y2 - y1|.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!