Calculate and return the area of a rectangle

Assignment Help MATLAB Programming
Reference no: EM13338876

Q1) 9. The cost of manufacturing n units (where n is an integer) of a particular product at a factory is given by the equation:

C(n) = 5n2 - 44n + 11

Write a script "mfgcost" that will

. prompt the user for the number of units n

. call a function "costn" that will calculate and return the cost of manufacturing n units

. print the result (the format must be exactly as shown below) 
Next, write the function costn, which simply receives the value of n as an input argument, and calculates and returns the cost of manufacturing n units. Here is an example of executing the script:

>> mfgcost

Enter the number of units: 100 
The cost for 100 units will be £45611.00 

Q2) If a certain amount of money (called the principal P) is invested in a bank account, earning an interest rate i compounded annually, the total amount of money Tn that will be in the account after n years is given by:

T_n=P(1+i)^n 

Write a function that will receive input arguments for P, i, and n, and will return the total amount of money Tn. Also, give an example of calling the function. 

Q3) Write a function calcrectarea that will calculate and return the area of a rectangle. Pass the length and width to the function as input arguments. 

Q4) In the metric system, fluid flow is measured in cubic meters per second (m3/s). A cubic foot per second (ft3/s) is equivalent to 0.028 m3/s. Write a script titled flowrate that will prompt the user for flow in cubic meters per second and will print the equivalent flow rate in cubic feet per second. Here is an example of running the script. Your script must produce output in exactly the same format as this: 
>> flowrate 
Enter the flow in m^3/s: 15.2 
A flow rate of 15.200 meters per sec 
is equivalent to 542.857 feet per sec 

Would you be able to help me solving them?

Reference no: EM13338876

Questions Cloud

What types of network servers and resources would necessary : What type of business applications would you deem important in a networked business office? What types of network servers and resources would be necessary to run these applications?
Write a description of the path a packet : Write a description of the path a packet takes across the Internet from destination A to destination B. What types of network devices does the packet pass through?
Design a wide area network wan between offices : Design a wide area network WAN between offices that includes the appropriate math calculations to meet the bandwidth. Describe the general type of LAN connections and hardware that will be used to interconnect the offices.
Justify whether or not network design will support vpn : Justify whether or not your network design will support dial-up or VPN remote access using descriptions of the following aspects: the advantages and disadvantages of your remote access solution.
Calculate and return the area of a rectangle : Write a function calcrectarea that will calculate and return the area of a rectangle. Pass the length and width to the function as input arguments.
Find the magnitude of the electric field and current density : The two cylinders both have a radius of 1mm. Material 1 has a conductivity of 1.2 x10^4 S/m and material 2 has a conductivity of 1.4 x 10^4 S/m. Piece 1 is 6cm long and piece 2 is 8cm long.
New product launch marketing plan : 1. Describe how your company will address the five product levels: core benefit, basic product, expected product, augmented product, and potential product.
Discuss the security of the network : Discuss the security of the network and suggest best practices for securing the business network.
What are the key elements of a drp : What is the purpose of a Disaster Recovery Plan (DRP)?

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd