If you have a 4D function, e.g., f(x,y,z,time), the best way to plot it (I think) is to fix one of the variables (e.g., time) and then create a 3D plot of the function that now only depends on three variables (because the fourth one is fixed). Then, you can keep increasing the fixed variable and will end up with several 3D plots.
For example, you can create a 3D plot when time=0, then when time=1 and so on.
An alternative that might not be as visually pleasing is to create 3 plots of each
One possibility is essentially a 3D animation (time being the fourth variable). Matlab can quite easily plot figures in 3D, so a 4D plot is a straightforward extension. An example is shown here:
(it is a surface in which z is a function of x and y which varies with time).
If you want to do something more complex such as a spatial image where each voxel value is a function of (x, y, z), then you probably want a volume rendering approach such as this one:
where voxel colour is rendered as a function of (x, y, z). If you make R=G=B then you have a 4D plot. You could also animate this and do a 5D plot, or try some fancy multidimensional colouring scheme (RGB = 3 dimensions) - animate that and you have visualised 8 dimensions! And probably you will have a major headache :-)
The ideas above are excellent options, but anothe way to solve the problem is to labeling with the comand "label" each time division could help you visualizing the time develop of your function.
In chaos theory, we have to plot the phase portraits of 4-D chaotic systems or 4-D hyperchaotic systems. We solve these 4-D systems of differential equations using ode23 / ode45 commands and then use plot3 command to plot (x,y,z) or (x,y,w) or (y,z,w) or (x,z,w) phase portraits.
It depends on what do you mean by 4D but there is a known solution for that. You can represent the last variable by other 3 variables on 3D plot but the 4th variable should be color map.