Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Background MATLAB has many built-in functions, but unfortunately there are many functions in the real world. Your task is to write custom functions that may

image text in transcribed

Background MATLAB has many built-in functions, but unfortunately there are many functions in the real world. Your task is to write custom functions that may come in handy later. If you store these functions in a folder that you've saved to your path list ("Set Path" from toolbar, then add the folder), then you can call them in any program you write Problem Part 1 For each of the following 3D shapes, write a function that takes however many inputs are necessary and returns two outputs: volume and surface area. Be sure to explain the inputs and outputs in the comment headings! Shape Cube Rectangular prism Cylinder Cone Sphere General ellipsoid Function name CubeVolSA RecPrismVolSA CylVolSA ConeVolSA SphereVolSA EllVolSA Number inputs 1 input 3 inputs 2 inputs 2 inputs 1 input 3 inputs S2 (a bac bc)1/ where p 1.6075) Part 2 Create an .m file (not a custom function) called PA1part2 with the sections shown. NO numbers should appear after the Declarations section! %% Declarations (each variable on its own line) % Anonymous functions (again, each function on its own line) OblSphVolFracUnc; %% Calculations (three volumes, three uncertainties, six lines) %% Output (display the results using fprintf) Do NOT use the input function for any variables. The user will manually define the variables' values. Define two anonymous functions: one for the fractional uncertainty of a two-variable equation and one for the volume of an oblate spheroid 4 "Calculations" should calculate the volume given R and H and the associated uncertainty. You should use your functions from Part 1 for the cone and cylinder. The "Output" section should present your results using fprintf for all three shapes with t and 3 symbols and THREE values after the decimal. Assume that the units are in centimeters in your output and when you comment your variables

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions