User Tools

Site Tools


supp:octave:contrib:surface_plot:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
supp:octave:contrib:surface_plot:start [2016/04/14 09:09] – created adminsupp:octave:contrib:surface_plot:start [2016/04/14 09:12] (current) – [Partial Solution] admin
Line 1: Line 1:
 ====== Octave: Surface, Contour (Isolines), Gradient ====== ====== Octave: Surface, Contour (Isolines), Gradient ======
 +
 +===== Functions of Two Variables =====
 +
 +{{:phy2:ss2013:surf.jpg?direct&300|}}
 +
 +In Octave analyse the function f(x,y) = x^2*y - 2*y.
 +
 +  * Understand what a meshgrid is, how it is generated and how it is used.\\ Define x=[-2:0.1:2]; and y=[-1:0.1:1]; and generate the meshgrid yielding X and Y.
 +
 +  * Define Z=(X.^2).*Y-2*Y; . Z is the matrix containing the function f evaluated at all points of the meshgrid.\\ Generate a surface plot in the first figure window.
 +
 +  * Generate a contour plot in the second figure window.
 +
 +  * Use the function [dX,dY] = gradient(Z); to estimate the gradient of f at each point of the meshgrid.
 +
 +  * Open a third figure window. Add a contour plot, hold the plot, and add a vector arrow plot (octave buit-in function quiver).\\ How are contour lines and gradient vectors related?
 +
 +==== Solution ====
  
 Download the script by klicking on the file name in the box header. Execute the file in Octave. Compare the results with the gradients determined in the lecture.  Download the script by klicking on the file name in the box header. Execute the file in Octave. Compare the results with the gradients determined in the lecture. 
supp/octave/contrib/surface_plot/start.1460624977.txt.gz · Last modified: 2016/04/14 09:09 by admin