Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB Question Make sure that figure 1 is plotted on screen when the script is executed. Only need answer for (c)(d)(e) 8 Answers are to
MATLAB Question
Make sure that figure 1 is plotted on screen when the script is executed.
Only need answer for (c)(d)(e)
8 Answers are to be reported as pX= where X is the problem number. * For example the answer to problem i should be reported as pl- $ if it is a single part question, and pla= if it is a multipart $ question. This is how to report your answer for a single part question pl = sind (180); * This is how to report your answer for a multi-part question p2a = exp(-2*pi); p2b = fix (2*pi); p2c = mean (1:5); p2d = 'my answer is ...'; 8 Answers are to be reported as pX= where X is the problem number. * For example the answer to problem i should be reported as pl- $ if it is a single part question, and pla= if it is a multipart $ question. This is how to report your answer for a single part question pl = sind (180); * This is how to report your answer for a multi-part question p2a = exp(-2*pi); p2b = fix (2*pi); p2c = mean (1:5); p2d = 'my answer is ...'; Problem 4: Use nested for loops to perform the following exercises. Do not use MATLB built-in function. (a) Create the 3-D function: M(x, y, z) = e-(sin(2x)cos(4y)tanh(z)]' in a rectangular domain with x = (-2:0.01:2]; y = (-1:0.01:1] and z = [0:0.01:1). Matrix M should have the dimension of length(x) by length(y) by length(z). Set p4a=M. (b) Compute the average value of M over the entire rectangular domain and put the answer into p4b. The answer should be a single number. (c) Compute the average values of M over the x-y planes and put the answer into p4c. The answer should be a vector with the dimension of length(z). (d) Compute the average values of M along the z-direction and put the answer into p4d. The answer should be a 2-D matrix with the dimension of length(x) by length(y). (e) Create figure 1. Use function surf to plot the answer in part (d), e.g. p4d, versus x and y. Remember to label the axes and give the figure a title. Set p4e='See figure 1
Step 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