Question

Matlab Questions (please show what code I need, including any comments): You are asked to design...

Matlab Questions (please show what code I need, including any comments):

You are asked to design a water storage tank with a capacity of 1,000 liters. The tank will be fabricated from stainless steel (rolled sheet), which cost $100/ sq. m. You are asked to consider three possible designs for the tank: Option 1 – a cube; Option 2 – a cylinder; Option 3 – a sphere. Calculate the cost of each of these designs and report the least expensive option.

• You should create a local function that has two inputs: tank capacity (volume) and material cost per sq. m. • Your function should evaluate and report the cost of each option ordered from lowest to highest. The output does not have to be fancy; something like this is adequate: Options: 3 1 2 Pricing ($): 90.8400 100.9100 123.4600 • For the cylinder, you can assume that the height and radius are equal (1 liter = 103 cm^3 = 10-3 m^3 )

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Matlab :-

Function CompareCosts :-

Make sure to create separate file and name it CompareCosts.m, Don't Run this file.

function [] = CompareCosts(V,C)
% V :- Required capacity in m^3
% C :- Cost per sq.m

%############## Option 1 : A Cube ##############
a = V^(1/3);                    % minimum a to get required V
S_Cube = 6*a^2;                 % Surface Area
Cost_Cube = C*S_Cube;           % Total Cost


%############## Option 2 : A Cylinder ##############
r = (V/pi)^(1/3);               % minimum r to get required V
S_Cyl = 4*pi*r^2;               % Surface Area
Cost_Cyl = C*S_Cyl;             % Total Cost

%############## Option 3 : A Sphere ##############
R = (3*V/(4*pi))^(1/3);         % R to get required V
S_Sphere = 4*pi*R^2;            % Surface Area
Cost_Sphere = C*S_Sphere;       % Total Cost

% Creating a vector containg costs for all three, in order option 1,
% option2, option 3
% The indices are the option numbers
Costs = [Cost_Cube,Cost_Cyl,Cost_Sphere];

% Sorting and getting index after sorting
[sorted_costs,Ind] = sort(Costs);

% Now sorted_costs contain costs sorted in ascending order (min to max)
% and Ind contain indices after sorting (Option numbers in sorted form)

% Printing Results
fprintf("Options : %d %d %d",Ind)
fprintf("\nPricing($) : %.2f %.2f %.2f\n",sorted_costs)
end

Script :-

Make separate file with any name, and run this file.

clc; clear;

% Required Capacity in litres
V = 500;
% Capacity in m^3
V = V*10^(-3);
% Material Cost per sq.m
C = 100;

% Call the function to display result
CompareCosts(V,C)

result :-

Add a comment
Know the answer?
Add Answer to:
Matlab Questions (please show what code I need, including any comments): You are asked to design...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Matlab Questions (please show what code I need, including any comments, for each of the questions):...

    Matlab Questions (please show what code I need, including any comments, for each of the questions): 1)  Initialize two row vectors a and b of arbitrary but equal lengths (pick any length ³3) with random numbers between 0 and 1. Recalling that the dot product between two vectors is a ∙ b = |a||b| cos theta, calculate the angle, theta, between the two vectors (radians or degrees is fine, just state what you used). Note: • You can use built-in inverse...

  • Please, I need help with program c++. This is a chutes and ladders program. The code...

    Please, I need help with program c++. This is a chutes and ladders program. The code must be a novel code to the specifications of the problem statement. Thank you very much. Assignment Overview This program will implement a variation of the game “chutes and ladders” or “snakes and ladders:” https://en.wikipedia.org/wiki/Snakes_and_Ladders#Gameplay. Just like in the original game, landing on certain squares will jump the player ahead or behind. In this case, you are trying to reach to bottom of the...

  • please help with this problem Problem Statement You are asked to design an exterior balcony for...

    please help with this problem Problem Statement You are asked to design an exterior balcony for a client. The client has a 7,000 sq ft 2-story house. He wanted to add a nice looking balcony to it. He showed you the rough sketches and dimensions. The balcony is to be supported on two simply-supported edge beams. Each beam is supported by two short columns, each column is supported by appropriate footings. is! slao - beams Supporting slab Columns supporting beans...

  • I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instruction...

    I need help modifying this code please ASAP using C++ Here is what I missed on this code below Here are the instructions Here is the code Produce correct70 pts O pts Full Marks No Marks results and statisfy requirements view longer Comments 1. Your display amount is not readable 2. I withdraw more than my balance, but I didn't see any error message description Documentations10 pts 0 pts Full Marks No Marks : comment i code and block comment...

  • i dont understand you please i need help preparing a one day meal for him "The...

    i dont understand you please i need help preparing a one day meal for him "The Heart Healthy Diet Analysis Unit #2 Diet Analysis Assignment "The Heart Healthy Diet Analysis" John was born on January 15, 1985. He is interested in practicing a healthier diet. He is currently 5 10" and 172 pounds. He is satisfied with this body weight but would like to lower his risk of developing heart disease. His father was recently diagnosed with heart disease and...

  • What additional information, if any, should be obtained before making a final decision? Downtown Parking Authority In J...

    What additional information, if any, should be obtained before making a final decision? Downtown Parking Authority In January a meeting was held in the office of the mayor of Oakmont to discuss a unicipal parking facility. The participants included the mayor, the traffic proposca the administrator of Oakmont's Downtown Parking Authority, the city planner, and the finance director. The purpose of the meeting was to consider a report Richard Stockton, executive assistant to the Parking Authority's administrator, concerning estimated costs...

  • I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this...

    I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this paper and some conclusions and contributes of this paper. I need this for my Finishing Project so i need this ASAP please ( IN 1-2-3 HOURS PLEASE !!!) SPECIAL ARTICLES tole of Monetary Policy C Rangarajan What should be the objectives of monetary policy? Does the objective of price stability conflict with the goal of achieving...

  • I need help to write a nice introduction for experiment 6 please ( no hands write ) typing Thank you HEAT TREATMENT OF STEELS EXPERIMENT 6 EXPERIMENT 6 HEAT TREATMENT OF STEELS THEORY The Ef...

    I need help to write a nice introduction for experiment 6 please ( no hands write ) typing Thank you HEAT TREATMENT OF STEELS EXPERIMENT 6 EXPERIMENT 6 HEAT TREATMENT OF STEELS THEORY The Effect of Cooling Rate One of the most convenient methods for controlling the properties of a given steel, i.e., a steel whose composition is already fixed, consists of austenizing the steel and ten cooling to room temperature at some predetermined rate. A variation of cooling rates...

  • Please use own words. Thank you. CASE QUESTIONS AND DISCUSSION > Analyze and discuss the questions...

    Please use own words. Thank you. CASE QUESTIONS AND DISCUSSION > Analyze and discuss the questions listed below in specific detail. A minimum of 4 pages is required; ensure that you answer all questions completely Case Questions Who are the main players (name and position)? What business (es) and industry or industries is the company in? What are the issues and problems facing the company? (Sort them by importance and urgency.) What are the characteristics of the environment in which...

  • I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this p...

    I need Summary of this Paper i dont need long summary i need What methodology they used , what is the purpose of this paper and some conclusions and contributes of this paper. I need this for my Finishing Project so i need this ASAP please ( IN 1-2-3 HOURS PLEASE !!!) Budgetary Policy and Economic Growth Errol D'Souza The share of capital expenditures in government expenditures has been slipping and the tax reforms have not yet improved the income...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT