Question: This is a MATLAB based question. function [message,Area] = n6904637trough(Func,EndPoint) [x,y,y0] = trough_create(Func,EndPoint); trough_plot(x,y,y0) Area = trough_area(x,y,y0); message = trough_error(y); end function [x,y,y0] = trough_create(Func,EndPoint)
This is a MATLAB based question.
![This is a MATLAB based question. function [message,Area] = n6904637trough(Func,EndPoint) [x,y,y0] =](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f5516b06767_19466f5516a8a7f0.jpg)
![trough_create(Func,EndPoint); trough_plot(x,y,y0) Area = trough_area(x,y,y0); message = trough_error(y); end function [x,y,y0] =](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f5516b9d48d_19566f5516b42197.jpg)
| function [message,Area] = n6904637trough(Func,EndPoint) [x,y,y0] = trough_create(Func,EndPoint); trough_plot(x,y,y0) Area = trough_area(x,y,y0); message = trough_error(y); end function [x,y,y0] = trough_create(Func,EndPoint) %INSERT CODE end function trough_plot(x,y,y0) %INSERT CODE end function Area = trough_area(x,y,y0) %INSERT CODE end function message = trough_error(y) %INSERT CODE end |
Inputs: Func - an arbitrary function that defines the bottom of the trough (eg. @(x) -log(x+0.01) + exp(x)) EndPoint - the second intersection point between Func(x) and Func(0) (for the previous example, EndPoint 1.8627) Outputs: Area a numerical approximation for the area of the trough, given the upper bound is defined by Func(0) and the lower bound is defined by Func(x). message - a message based on the validity of the area that was calculated. The function should also output a plot of the trough cross-section. This overall function can be broken into four parts - vector creation, plotting, area calculation and display messages. Each of these parts can be solved with a separate function. These functions can then be merged together to form the overall function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
