Question: In Matlab: Write a Script that tests to see if the input value given by a user is negative. If it is negative, use fprintf
In Matlab:
Write a Script that tests to see if the input value given by a user is negative. If it is negative, use fprintf to print the message to the screen : Warning: The input value n is negative. where n is not literally the letter n, but is the value of the input to the function. Assume the input value is a floating-point number, so use an appropriate format in the fprintf to print the value with 2 decimal places. If the value of the input is not negative, dont print anything.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
