Answered step by step
Verified Expert Solution
Link Copied!

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

Ex4-5: Mesh and plot a surface
My Solutions >
Write a function named ex4p5. It received two vector variables and returns three matrices.
Write a subfunction that implements the "three-hump camel" function:
f(x,y)=2x2-1.05x4+x66+xy+y2
Write your subfunction in such a way that it accepts "vectorized" input (i.e. it computes function values elementwise when x and y values).
Your main function receives to variables which contain the ranges of x and y, i.e.xmin,xmax and ymin,ymax.
Your main function returns as output values three 1010 matrices, which contain the x,y coordinate combinations (use the "meshgrid" function, two first values) and the corresponding z=f(x,y) 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 z-axis.)
(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 2D line? Or if both coordinate ranges were scalars, function would return just the function value with the given pair of coordinates?)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions