Problem

For each MATLAB code segment shown, write the function header necessary to convert the cod...

For each MATLAB code segment shown, write the function header necessary to convert the code segment into a function. Use the guidelines specified with each problem.

(a) Assume there only needs to be one function output, the variable X and that the function will be stored in a file named CandyCrush.m.

X = 1A + B + B^A2*pi;

(b) Assume the function should have five output variables: the paintable area of each wall (all 4 walls) and the total paintable area. You may assume this function will be stored in a file named FullHouse.m.

P1 = Wall1 * RoomHeight;


P2 = Wall2 * RoomHeight;


P3 = Wall3 * RoomHeight;


P4 = Wall4 * RoomHeight;


PaintableArea = P1 + P2 + P3 + P4;

(c) Assume the function should have 3 output variables: the minimum value, the maximum value, and the average value. You may assume this function will be stored in a file named MinMaxMean.m.

MyMin = min([D,D^2,D*10]);


MyMax = max([D^3,D*3,D + 3000]);


MyMean = mean([D/2,D/3,D/4]);

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
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