Question: Write a matlab script that will work like the find function. The user should enter a vector or matrix. Input a value to compare with

Write a matlab script that will work like the find function. The user should enter a vector or matrix. Input a value to compare with your matrix. Using a menu, the user will choose whether to a find the location and value in the given vector or matrix that is (1) equal to, (2) greater than, (3) less than, (4) greater than or equal to, (5) less than or equal to, or (6) not equal to. The script should output a .csv file that contains the row locations in column one, the column locations in column two, and the value in column three where these conditions are met. As well, as a table that shows all the rows, columns, and values

Coding Requirements:

User input for the matrix

Do not use the built-in function max or min or any similar function (size and length are acceptable).

Implicit Loops are NOT allowed. Do not use the colon : operator to address array elements such as A(:,k) or A(g,:).

You MUST use explicit loops (For loops)

Data Validation Requirements:

Check that a single integer has been entered. Must ask for a single integer 3 times, and then error and exit the program)

Produce an error message for exiting the menu statement

If there is no answer, must error that there are no values.

Must check that all the elements in the matrix are the same sign as the integer being compared

Write a matlab script that will work like the find function. The

Output would include showing them the warning, the error message from one Test Case 1: Showing Warning and Error Command Window Enter a vector or matrix of your choice: 4,10,-3,0,2,-2,-0.1,2,5] The number you would like to compare it to: [4,3] Warning: Enter a single value: Enter a single value: [1,1,4] Warning: Enter a single value: Enter a single value: [1,1;2,2] ERROR: exceed number of tries to enter an integer Test Case 2: Results (multiple locations) Find negative numbers (Choose less than in menu) MENU Command Window What conditional operation would you lke so perform? Enter a vector or matrix of your choice: [4,10,-3,0,2,-2,-0.1,2,5] The number you would like to compare it to: 0 Rows Columns Value 1 3 3.00 1 6 2.00 1 7 -0.10

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!