Question
Please run the code before you submit your solution. Create a single script (.m file) to complete this assignment, plus such separate function file(s) (.m
Please run the code before you submit your solution. Create a single script (.m file) to complete this assignment, plus such separate function file(s) (.m file(s)) as are requested in the prompts. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. For this assignment do not suppress your output with semi-colons (;). The main script code for each problem (i.e. Problem 2 and Problem 3) should be in a separate cell of your script, using the cell mode feature of MATLAB. Your submission must be a single script plus such separate function file(s) as are requested in the prompts.
2. Create an anonymous function cube that cubes the value(s) from any scalar, column matrix, or row matrix entered into it. Hint: Use element-by-element array operations. 3. Given a radius r, the area of a circle is given as A Tr2 (1) Similarly, the volume of a sphere is given as (2) Tr Declare r as a global variable in your main code. In a function, calculate the area of the circle and the volume of the sphere with the given radius r, returning these values to the main code. Your function should have no inputs and two outputs. You should neglect units for this problem, and use the value r 5Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started