Question: MATLAB PROBLEM. Please help! I can't get these! Please answer both questions! Will Rate. I appreciate you!! Write a MATLAB program called PaidPennies that calculates
MATLAB PROBLEM. Please help! I can't get these! Please answer both questions! Will Rate. I appreciate you!!



Write a MATLAB program called PaidPennies that calculates how much a person would earn if the salary were one penny on the first day, two pennies on the second day, and three pennies on the third day, and then would continue to increase in this way each day. The program should prompt the user to enter the number of days of employment. The program should display the answer in a sentence. For example: >>PaidPennies How many days of employment? 10 Being employed for 10 days earns $e.55 IMPORTANT NOTE: Cody does not test the "prompting" code, nor the displayed answer. Cody tests for correctness of the answer only. Name the input variable days. Place the computed value of salary into a variable named s Your Function C ResetMATLAB Documentation function S-PaidPennies (days) 2 %Replace the line below with code to compute the salary and assign it to variable s 3 S days; 4 end Write a MATLAB program called SinCurve to plot one cycle of f(t)-sin(wt) using t = 100 linearly-spaced points from 0 to T where T is the period of the sine curve The period of f(t)-sin(wt) is 2pi/w The program should prompt the user for the value of w (called angular frequency). The sine curve should be plotted with a green line, and should include a title. For example >>SinCurve Enter the angular frequency: 2*pi IMPORTANT NOTE: Cody does not display a figure window, However, Cody can test for the correctness of items on the figure window Name the input variable w. Place the array of 100 values into an output variable named t The output will look like this, for any value of w sin(wt) 0.8 0.6 0.4 0.2 0.2 0.4 -0.6 -0.8 -1 02 03 04 0.5 06 07 08 091 Your Function C Reset MATLAB Documentation 1 function tSinCurve(w) 2 close all %keep this here!! %Replace the line below with code to plot one cycle of sin(it) with 100 evenly-spaced points, ihich are saved as output variable t st 6 end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
