Question: Okay I need as much help as possible, I'm new to MatLab and this exercise is confusing to me. I attached the original problem as

 Okay I need as much help as possible, I'm new toMatLab and this exercise is confusing to me. I attached the original

Okay I need as much help as possible, I'm new to MatLab and this exercise is confusing to me. I attached the original problem as well as what I have so far. I dontunderstand what "f.m" means so if you could explain that too. Script also in plain text below. Anything helps thanks!

function f = f(x)

if x

f = 1-x;

elseif x

f = exp(x-13);

elseif x ~= 13

f = x/(x-13);

else

fprintf('The function is undefined at x = 13');

end

end

EXERCISE 5 Write a function file that creates the following piecewise function: - 2 f(x) e2-13 x 3-13 7 Assume x is a scalar. The function file should contain an if statement to distinguish between the different cases. Also, if the input is x = 13, the function should display the function is undefined at x = 13. Test your function by evaluating f(4), f(5), f(5.5), f(10), f(13) and f(14) Exercise 5 NOTE: Here, you must create a separate function M-file f that accepts one input argument, a value of the variable x. You may want to start creating a new folder for each lab as we will be using f multiple times to define different functions. Please refer to the example on the last page of the protocol before attempting this problem. Delete this note before submission. Display contents of function f M-file. = type 'f.m' function f = f(x) if x

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!