Reading a value from a gridded surface

The code below samples a function on a rectangular grid before drawing it with plot_surface.


Python
x = np.linspace(-2, 2, 9)
y = np.linspace(0, 3, 7)
X, Y = np.meshgrid(x, y)
Z = X**2 + 3*Y


What value is stored in Z[4, 1]? Give your answer to two decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Creating Specialized and Three Dimensional Plots Questions: