Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab Help! 3.1 Write a script that creates two sub-plots in two columns cach with one row. Plot the following two functions. The first plot
Matlab Help!
3.1 Write a script that creates two sub-plots in two columns cach with one row. Plot the following two functions. The first plot on the left is y-l-e sE, and the second plot on the right is e-sor Let x be from 0 to 10 with increment 0.1. The first plot is in blue color, solid line and the second is in red color, dotted line. Turn both grids on. Both figures should have own title and x-axis and "y-axis" labels. Note that you should plot both according to the above instruction. Show the script file and resulting figure. Answer: Script File: Figure: 3.2 A worker is paid according to his hourly wage up to 40 hours per week, and 50% more for overtime in the next 15 hours. If a worker works more than 55 hours, this overtime is paid 100% more. Write a program in a script file that calculates the pay to a worker. The program asks the user to enter the number of hours and the hourly wage. The program then displays the pay. Test your program on two cases: (a) 30 hours and S10 hourly wage (b) 50 hours and $9 hourly wage ( 60 hours and $9 hourly wage. Show the program a Answer: Script Filc: Testing R Dr. Frank Shih 3.3 Suppose that a student has the option of enrolling for a single elective during a term. The student must sclect a coursc from a limited list of options: "English," "History," "Biology," "Computer," or "Math." Construct a fragment of MATLAB code that will prompt the student for his or her choice read in the choice, and use the answer as the case expression for a switch construct. Be sure to include a default case to handle invalid inputs. Testing three cases: (a) Computer (b) Physics (c) Biology. Answer: Script File: Testing Result: 3.4 (a) Use a while-end loop in a script file to calculate the sum of the first n terms of the series: (k +k-). Show the script file and the two results of n -5 and n-30. (b) Use a for-end loop in a script file to calculate the sum of the first n terms of the series: 2 (k +k'). Show the script file and the two results ofn-5 and n-30Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started