Search code examples
matlabplot3ddepth

How do I display data as X-Z rather than X-Y in Matlab


I have some data which is increasing in the X-direction, planar in the Y-direction, and increasing the Z-direction.

i.e

x=[50,100,200,500,1000,1500,2000,2500,3000,4000,5000]
y=[0,...,0]
z=[0,-50,-100]
v=[0.334154E+01,0.334365E+01,0.309437E+01,0.159239E+01,0.268583E+00,0.136498E+00,0,715942E-01,0.374466E-01,0.213738E-01,0.857945E-02;0.371473E+01,0.368870E+01,0.333723E+01,0.154042E+01,0.436171E+00,0.114251E+00,0.612380E-01,0.314262E-01,0.176596E-01,0.691471E-02;0.408684E+01,0.397664E+01,0.348693E+01,0.153165E+01,0.362640E+00,0.892584E-01,0.504035E-01,0.252160E-01,0.138627E-01,0.522760E-02]

Is there a way to plot this data in Matlab, such that the Z-axis is actually downwards facing?

I appreciate this can be done as contourf, to represent the Y-axis as depth. However, when I need to expand the Y-axis to include more lines, I don't believe contourf will work.
Surf is also not sufficient, as the axis needs to increase with depth.

The concept is very similar to the 'slice' function, but I only have 1 slice...


Solution

  • A possible solution is to add the 'y' value to the 'v' values for each 'y' row.

    i.e. values for the 1st row = v, values for the second row = v+y, third row = v+2*y.