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

  Parking in garage using matlab

In matlab: parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour.

  Matlab program which will determine your vehicle fuel usage

Create a MATLAB program which will determine your vehicle fuel usage (MPG, miles/gallon) rating for a user defined number of trips ('for' repetition structure). Review the voiceover supplied for an example of the required input/output from this progr..

  Generate a sphere of diameter 3. create 3 vectors

Generate a sphere of diameter 3. Create 3 vectors representing the translation of this sphere along the x, y, and z axes. Generate the correct vectors given the description below: The sphere should be translated to (-10, -10, -10).

  Write a user-defined matlab function

Write a user-defined MATLAB function that calculate the condition number of an (nxn) matrix by using the 1-norm. for the function name and arguments use c = condNum_one(A).

  Open a named pipe and to read data from the pipe

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

  Kerfuffleboard is a game very much like shuffleboard

Kerfuffleboard is a game very much like Shuffleboard. Players take turns shooting disks at a trianglular scoring area. While the scoring areas are the same in shuffleboard and kerfuffleboard, a disk's contribution to a player's score will be calcu..

  Use the definition for the laplacian in the discrete case

Show that subtracting the Laplacian from an image is proportional to unsharp masking. Use the definition for the Laplacian in the discrete case to derive the equivalence relation, constant weighting factors should not affect your conclusion.

  It turns out that since you''ve become experts

It turns out that since you've become experts on rating clothing, Acme Clothing Company has hired you to rate their clothes. Clothes are now represented as structures instead of vectors with the fields (all of which are numbers between 0 and 5): C..

  Give examples of appropriate values

Give examples of appropriate values for each of the following type expressions. Do not use the empty list as the value for any list component

  Value for the side of the octagonal prism

Value for the side of the octagonal prism, and a scalar value for the height of the octagonal prism. Generate the x,y,z arrays that define the 9 faces of the pyramid (octagonal base and 8 triangles. Use fill3 command to create the faces (faces wit..

  Linear support vector machine svm

Write a computer program to prepare a Linear Support Vector Machine SVM.

  Import the data into matlab and name the array ace_data

Parameter is related to the energy of the storm, since kinetic energy is proportional to velocity squared. However, it does not take into account the size of the storm, which would be necessary for a true total energy estimate.

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