You can use slice and contourslice to visualize 4D data. For example
[X,Y,Z] = meshgrid(-5:0.1:5);
C = 3*X+4*Y+Z;
figure();
slice(X,Y,Z,C, [-2 0 2], [], [-2 2]);
figure();
contourslice(X,Y,Z,C, -5:1:5, [], []);
view(3);




Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!