Question

In: Mechanical Engineering

Create four anonymous functions to represent the function 6e3cosx2, which is composed of

Create four anonymous functions to represent the function 6e3cosx2, which is composed of the functions h(z) = 6ez, g(y) = 3 cos y, and f(x) = x2. Use the anonymous functions to plot 6e3cosx2 over the range 0 ≤ x ≤ 4.

Solutions

Expert Solution

It is required to create four anonymous functions to represent

6e3cos(x2)

 

And plot it over the range

0 ≤ x ≤ 4

 

The other three functions are

h(z) = 6ez

g(y) = 3cos(y)

f(x) = x2

 

We can use the MATLAB syntax for creating the function

func = @ (x) ‘Expression’ and we can use the plot command to plot.

 

The MATLAB code is given below. Three simple functions given are to be compounded to achieve the fourth function. We need to calculate the function of function.

Input:

 

% creating functions

f = @(x) x.^2;

g = @(y) 3*cos(y);

h = @(z) 6.*exp(z);

% generating data points

x = 0:0.01:4;

% creating the fourth function

y = h(g(f(x)));

plot(x, y)

grid on

 

Output:

 


It is required to create four anonymous functions to represent

6e3cos(x2

Related Solutions

On 1/1/19 the management team for Expeditions Anonymous is trying to decide which of four investment...
On 1/1/19 the management team for Expeditions Anonymous is trying to decide which of four investment opportunities to pursue. The expected cash receipts from each opportunity are as follows: OPTION 1: Receive $85,000 today plus $5,000 at the end of each year for 10 years and an additional $10,000 at the end of the 10th year OPTION 2: Receive a one-time amount of $320,000 at the end of 12 years OPTION 3: Receive $129,000 today OPTION 4: Receive $11,000 semiannually...
1. The following two linear functions represent a market (thus one is a supply function, the...
1. The following two linear functions represent a market (thus one is a supply function, the other a demand function). Circle the answer closest to being correct. Approximately what will suppliers willingly supply if the government controls the market price to be $3.00 (You must first find the market equilibrium price and quantity in order to see how the $3.00 relates to them)? Q = 100 – 4.6P and Q = 75 + 6.2P Possible answers: 2.3 84.3 86.2     89.3    ...
If it needs more information be specific. JavaScript Functions Create the makeBranches() function that will be...
If it needs more information be specific. JavaScript Functions Create the makeBranches() function that will be used to append node branches to the node tree diagram. The function will have two parameters named treeNode and nestedList. The treeNode parameter stores the current node from the source article and the nestedList parameter stores the structure of the node tree displayed in the web page. Add the commands described in the steps below. Each time the makeBranches() function is called, it is...
. Create a class called Book to represent a book. A Book should include four pieces...
. Create a class called Book to represent a book. A Book should include four pieces of information as instance variables‐a book name, an ISBN number, an author name and a publisher. Your class should have a constructor that initializes the four instance variables. Provide a mutator method and accessor method (query method) for each instance variable. Inaddition, provide a method named getBookInfo that returns the description of the book as a String (the description should include all the information...
Requirements: In this assignment, you are going to create two switch functions. The first function is...
Requirements: In this assignment, you are going to create two switch functions. The first function is going to be called switchVal and the second is going to be called switchRef. The goal of this assignment is to demonstrate the understanding of what pass-by-reference (Links to an external site.) and pass-by-value (Links to an external site.) do when working with functions that you create. The two functions that you will modify need to accept two parameters and inside them they need...
which statements are true about Python functions? a)Different functions cannot use same function name b)a function...
which statements are true about Python functions? a)Different functions cannot use same function name b)a function always returns some value c)different function cannot use the same variable names d) function must use the same parameter names as the corresponding variables in the caller what benefits does structuring a program through defining functions bring? a) there is a possibility of reducing the number of variables and/or objects that must be managed at any cost at any one point b)the program is...
List four functions banks perform. Give a detailed response for each function
List four functions banks perform. Give a detailed response for each function
Which of the following is one of the four main functions of theFederal Reserve?To...
Which of the following is one of the four main functions of the Federal Reserve?To regulate student loan debt and interestTo issue bonds to consumers and increase money supplyTo grant loans to consumers with low interest ratesTo serve as the banker for the government
Transcribing Anonymous SEC Tips Java or Python    * The function is expected to return a STRING_ARRAY....
Transcribing Anonymous SEC Tips Java or Python    * The function is expected to return a STRING_ARRAY.      * The function accepts following parameters:      *  1. STRING_ARRAY inputNames      *  2. STRING_ARRAY secRecords      */ Problem Statement Introduction Imagine you are helping the Security Exchange Commission (SEC) respond to anonymous tips. One of the biggest problems the team faces is handling the transcription of the companies reported by the callers. You've noticed that sometimes the company name is misheard by the person taking the call, sometimes...
Create a function named ‘dividing’. This function will take one parameter value, which will be an...
Create a function named ‘dividing’. This function will take one parameter value, which will be an integer. For the function you will use ‘Exception Handling’ with the use of the try and except statements to try and return the results of a number divided by the parameter value given to the function. If the parameter passed to the function is the integer value of zero then your function should return ‘You tried to divide by zero!’ through the use of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT