Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Ex 4 - 5 : Mesh and plot a surface My Solutions > Write a function named ex 4 p 5 . It received two
Ex: Mesh and plot a surface
My Solutions
Write a function named exp It received two vector variables and returns three matrices.
Write a subfunction that implements the "threehump camel" function:
Write your subfunction in such a way that it accepts "vectorized" input ie it computes function values elementwise when and values
Your main function receives to variables which contain the ranges of and ie and
Your main function returns as output values three matrices, which contain the coordinate combinations use the "meshgrid" function, two first values and the corresponding values as the third function value
Draw the function surface using the function "surf". Give your figure a title and label the axes. Note that the Moodle interface does not display figures use Matlab to see what you've drawn. To see the "humps" you need more points than ten points in each direction and probably also a logarithmic zaxis.
Food for thought do not return: How you could change your function so that if one of the coordinate ranges would be just a scalar, it would draw a D line? Or if both coordinate ranges were scalars, function would return just the function value with the given pair of coordinates?
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