(adsbygoogle = window.adsbygoogle || []).push({}); Using "surf" function to plot slices of a 3D matrix

Hello

I have a 100x100x100 matrix called "A" and want to plot 2D slices of it to get a feel of where the global minima are (since there is no other way which I know of visualising it... is there?)

If I take a slice of the third component, eg. "surf(A(:,:,50))" it will plot it fine, but I cannot do this for the other two:

Is there a simple workaround for this?Code (Text):>>> surf(A(1,:,:))

??? Error using ==> surf at 74

Z must be a matrix, not a scalar or vector.

Thanks

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Using surf function to plot slices of a 3D matrix

**Physics Forums | Science Articles, Homework Help, Discussion**