Question: Problem 9: Write a function check_hw1_09(x) that takes in a vector X as input and displays an error message on the terminal unless every element

Problem 9: Write a function check_hw1_09(x) that takes in a vector X as input and displays an error message on the terminal unless every element is nonzero. In case none of the elements is zero, it will display another message indicating no error. You have the flexibility to define your messages. The example below shows the simplest forms of the message. Attach examples of input and output. Note that this function does not return a numeric value as the output. >> y2 = [45, 90, 10, 12, 98, 76]; >> yi = [19, 12, 0 35, 41]; >> check_hwl_09 (yl) Error: Zero Found >> check_hwl_09 (42) No Zeros. Hint: You can use 'if else' conditions in a loop to solve the above problem, in-built "length' function might be necessary
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
