4d plotting with slices
Show older comments
Hello :)
I have 4d data (x y z coordinates and and V). I am hoping to represent the data similar to the slice function approach however I do not want the V values to be inerpolated for each square. I want each square to represent one of my data points (so x = 0, y=0, z=0 is a whole square not the inersection of squares as the slice function does). I could also potentially have a graph with circles for each data point or any other suggestions. I just need every data point to be visible.
[X,Y,Z] = meshgrid(0:4, 0:4, 0:3);
V = [0.95, 1.05, 0.87, 0.9, 0.66;
1.25,1.79, 18.1, 1.18, 1.22;
1.95, 6.27, 37.4, 6, 2.13;
3.06, 3.94, 11.4, 2.4, 1.8;
1.1, 1.3, 3.2, 1.8, 0.8];
V(:, :, 2) = [2.9, 2.7, 1.9, 3.1, 2.1;
1.1, 5.7, 18.5, 7.4, 0.6;
3, 10.9, 37.8, 14.5, 4.2;
2.6, 7.4, 9.4, 6.2, 3.8;
3, 2.2, 5.2, 3.8, 3];
V(:, :, 3) = [1.8, 3.2, 3, 3, 2.2;
3, 3, 14.9, 7.4, 1.8;
3.2, 10.7, 11.5, 23.9, 6.6;
2.2, 7.8, 9.8, 8.6, 3.8;
1.6, 1.8, 3.8, 3.8, 3];
V(:, :, 4) = [1.8, 2, 5, 4.4, 3.8;
2.2, 9.4, 8.8, 17.9, 5.8;
3.4, 20, 26.1, 20.1, 6.2;
4.4, 14.3, 6.6, 13.7, 6.6;
3.8, 3, 7.6, 3.4, 2.6];
zslice = [];
xslice = [0,1,2,3,4];
yslice = [];
figure
slice(X, Y, Z, V,xslice,yslice,zslice);
pbaspect([3 1 1])
colorbar
xlabel('X'); ylabel('Y'); zlabel('Z')
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
