Chat with us, powered by LiveChat MATLAB HOMEWORK | Writedemy

MATLAB HOMEWORK

MATLAB HOMEWORK

Use MATLAB to solve each problem by writing script files; copy and paste the script file AND the results in the Command Windowand/or plot in the Figure Window to a WORD document that has your name and section in the headers of each page and the page number in each footer. Edit the output to remove extra lines and empty spaces. The script files SHOULD have comments for easy readability; take a print out of the Word file and staple before submission.

1. The height and speed of a projectile launched with a speed of v0 at an angle A to the horizontal are given by:

h(t) = v0t sin A –0.5gt2

v(t) =

where g is the acceleration due to gravity. The projectile will strike the ground when h(t) = 0, which gives the time to hit thit = . Suppose that A = 30, v0 = 40 m/s, g = 9.81 m/s2. Use MATLAB relational and logical operators to find the times whena. The height is no less than 15 m.

b. The height is no less than 15 m and the speed is simultaneously greater than 36 m/s.

c. The height is less than 5 m or the speed is greater than 35 m/s.

d. Verify your answers by plotting h(t) and v(t) versus t with the same axes.

2. The price, in dollars, of a certain stock over a 10-day period is given as:

price = [19,18,22,21,25,19,17,21,27,29].

Suppose you owned 1000 shares at the start of the 10-day period, and you bought 100 shares every day the price was below $20 and sold 100 shares every day the price was above $25. Use MATLAB to compute (a) the amount you spent in buying shares, (b) the amount you received from the sale of shares, (c) the total number of shares you own after the 10th day, and (d) the net increase in the worth of your portfolio.

3. Use a for loop to plot the following function, over the interval –2 x 6.

for x < -1= 2 + cos(x) for -1 x < 5

= 10(x-5) + 1 for x 5

The variable y represents height in kilometers, and the variable x represents time in seconds. Include title, grid, and axis labels.

4. Electrical resistors are said to be connected “in series” if the same current passes through each and “in parallel” if the same voltage is applied across each. If in series, they are equivalent to a single resistor whose resistance is given by

R = R1 + R2 + R3 + R4 + …+ Rn

If in parallel, their equivalent resistance is given by

Write an m-file that prompts the user for the type of connection (series or parallel), the number of resistors n, the values of resistors, and then computes the equivalent resistance.

5. Write a program in a script file that calculates the cost of renting a car according to the following price schedule:

Type of car Rental period
1-6 days 7-27 days 28-60 days
Class B $27 per day $162 for 7 days, +$25 for each additional day. $662 for 28 days, +$23 for each additional day.
Class C $34 per day $204 for 7 days, +$31 for each additional day. $284 for 28 days, +$28 for each additional day.
Class D Class D cannot be rented for less than 7 days. $276 for 7 days, +$43 for each additional day. $1,136 for 28 days, +$38 for each additional day.

The program asks the user to enter the rental period and the type of car. The program then displays the cost. If a period longer than 60 days is entered, a message “Rental is not available for more than 60 days” is displayed. If a rental period of less than 6 days is entered for class D, a message “Class D cars cannot be rented for less than 6 days” is displayed.

Run the program nine times for the following cases:

Class B, for 3, 14, and 50 days. Class C, for 20, 28 and 61 days. Class D for 6, 18, and 60 days.

Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

About Writedemy

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.

Hire a tutor today CLICK HERE to make your first order