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

  Calculate the inverse of a function

Using matlab write the function [Bag,x] = EG(A,b) to solve the system without pivoting. The solution is the vector x and flag is 0 when the algorithm is completed and 1 otherwise.

  Write a functions

The function range basis takes a matrix A as input, and outputs a basis (again written as columns) for the range space of A.

  Determine the level of absolute approximate relative error

2006ENG Numerical and Data Analysis. Convert the equation into f(T) = 0 when cp of 1.1kJ/kgK. In our MATLAB program, develop a plot of f(T) versus a range of T = 0 to 1200 K. MATLAB. On the axes, put proper labelling.

  Write a function that takes a list of integers

Using ML write a function that takes a list of integers as argument and returns a pair consisting of the sum of the even position and the sum of the odd positions of the list.

  Create an output array using input x values 1 through 10

The function is y=(x)/(sqrt(x)), create an output array using input x values 1 through 10. I can't seem to get this to work for some reason...

  Define the future-value-of-money formula

The future-value-of-money formula relates how much a current investment will be worth in the future, assuming a constant interest rate.

  Develop a well-structured function

Develop a well-structured function to compute v as a function of t. Then use this function to generate a table of v versus t for t = -5 to 50 at increments of 0.5.

  Determine the inputs, outputs, relevant formulas

determine the inputs, outputs, relevant formulas

  Elementary numerical methods and programming

Project involes determining the dynamics of the double pendulum with a sliding base. Each link is assumed to be of square cross section - MECH 3010: Elementary Numerical Methods and Programming

  Dimensional plot of the free surface charge

Include a qualitative dispersion curve sketch thatdemonstrates the operating point at which your Matlab plot applies.

  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.

  Characterizing population of about countries

Select 10 features characterizing the population of about 100 countries. load it into Matlab. Normalize the data between 0 and 1. (min, max and minmax are some useful Matlab commands)

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