1 / 3

Problems and solutions Session 5

Problems and solutions Session 5. Problems. Draw the contour plot of function F(x,y) = x 1.5 y 2 exp(-(x-2)-(y-0.5)) on [0,5]x[0,5] and its gradient field with quiver command in the same picture. Use meshgrid to create the X,Y –grid.

aliya
Download Presentation

Problems and solutions Session 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Problems and solutionsSession 5

  2. Problems • Draw the contour plot of function F(x,y) = x1.5y2exp(-(x-2)-(y-0.5)) on [0,5]x[0,5] and its gradient field with quiver command in the same picture. • Use meshgrid to create the X,Y –grid. • Compute the derivative by hand or by using your earlier differf.m function. • Make a histogram of points randn(10000,1). Introduction to MATLAB - Solutions 5

  3. x = 0:.25:5; % negative x gives complex values, so change the domain [X,Y] = meshgrid(x,x); expterm = @(X,Y) exp(-(X-2)-(Y-0.5)); FXY = X.^1.5.*Y.^2.*expterm(X,Y); dxFXY = 1.5*sqrt(X).*Y.^2.*expterm(X,Y)- FXY; dyFXY = 2*X.^1.5.*Y.*expterm(X,Y)-FXY; contour(X,Y,FXY) hold on quiver(X,Y,dxFXY,dyFXY) hold off hist(randn(10000,1),50) Some solutions Introduction to MATLAB - Solutions 5

More Related