MATLAB Input and Output
Requirements
1) You will create a separate MATLAB script file (.m file) for each question.
2) You will name each script using the following naming convention
a. YOURLASTNAME_MATLAB_logic_problem_01.m
b. YOURLASTNAME_MATLAB_logic_problem_02.m
c. YOURLASTNAME_MATLAB_logic_problem_03.m
d. YOURLASTNAME_MATLAB_logic_problem_04.m
e. Etc.
3) You will upload all your files to Blackboard at the same time, one submission, do NOT submit
each script as separate submissions. To do this you will need to attach all of your files at the same
time.
Questions
1) Write a MATLAB script to prompt a user to input two numbers, then assess whether the two
numbers are equal or not. If the two numbers are equal, display that they are equal in the
Command Window. If they are not equal, display that they are not equal in the Command
Window.
2) Write a MATLAB script that prompts the user to enter the day of the week using the input
function. If the information the user enters is equal to “Saturday” or “Sunday”, display “have a
nice weekend” in the Command Window. Otherwise, display “Good luck in your class lectures
and your studies.”
3) Write a MATLAB script that prompts the user to input the following array by providing an
example in the prompt: [2 4;6 3;5 9]. Check if the user has input the array properly. If the
information entered by the user is correct, display a statement to the Command Window
informing the user they have entered the array correctly. If the user has not entered the array
correctly, display a statement to the Command Window notifying the user that they have not
entered the array correctly.
4) Write a MATLAB script that prompts the user with the selection window provided on the next
page (using the menu command) and then saves the user’s response as ‘user_val’. Then, print the
string on the button associated with the user’s response in the command window.