Question: Please do it in matlab 4. (30 points) Write a MATLAB script (Classic program) that: (a) Prompts it user to enter a valid expression (b)
Please do it in matlab 4. (30 points) Write a MATLAB script (Classic program) that: (a) Prompts it user to enter a valid expression (b) Reads what the user types (unevaluated) into a string variable (c) Determines if the string is a valid expression based on the following rules: Consists of only the following characters: +', -, and the digits 'O' through '9' inclusive The '+' character is never folowed by a '+' or ' character The ' character is never folowed by a '+' or ' character . Consists of at least 1 digit sequence (d) Display what the user entered and the determination to the screen in a reasonable report like Sample run(s): Run 1: Please enter a valid expression:+ + is not a valid expression format Run 2: Please enter a valid expression: 2 2 is a valid expression Run 3: Please enter a valid Integer literal 1-42+3748384+44-33 1-42+3748384+44-33 is a valid expression
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
