# Generating 4D Plots in Matlab

I have some data in the form of:

       X  Y  Z    Amplitude
0  0  0    0.00
1  0  0    0.00
2  0  0    0.00
3  0  0    0.00
...
27 30  8    0.25
28 30  8    0.25
29 30  8    0.25
30 30  8    0.25


and I want to show them in a 3D plot, with Amplitude either shown in color or with isosurface shapes. The number of elements in each vector exceeds 8000, so I cannot use meshgrid command (results in insufficient memory error).

• Does it have to be Matlab? For large 3d datasets, more sophisticated visualization software such as Paraview or VisIt might be called for. As a stopgap measure, you could try to convert X, Y, Z to single or (if they in fact are, as in your example) int before calling meshgrid. – Christian Clason Jul 25 '16 at 17:24
• ... which, as Matlab informs me, would still take about 950Gbyte memory. You should either subsample before plotting (I doubt such a high resolution is actually useful on a standard monitor -- 8000x8000x8000 is more than 500 billion points) or use a different software (or both). – Christian Clason Jul 25 '16 at 17:33