I have a double of 3D Matrix in MATLAB and I need to plot that. What is the function to be used for that and is it possible to plot it as 2D multiple plots for the z direction
For the first part of your question (as Aaron has mentioned), there are several MATLAB built-in functions you could use: scatter3, contour3,surf, plot3, etc, However, you should choose the proper function based on your need, and maybe visualization purpose. You may find bunch of good examples in MATLAB:
For the second part, "Yes", you can (again it depends on your intention). Nonetheless, you should be careful about the nature of your data. There are some differences between what meshgrid does and what a 3D matrix can be. If your matrix is something like this:
X Y Z
1 2 3
2 4 6
3 8 12
and, each row represents one certain coordinate points (Mat(1,1),Mat(1,2),Mat(1,3)), you could simply break it down into several vectors and plot them separately. If this is the case (with some variations, because you have mentioned you want to use a couple of 2D data), I think it would be rational if you avoid using 3D matrix and instead work with 2D data (simply in a loop). But, if your data represent a surface (grid vectors) and you want to extract 2D lines, different approach may be taken.
For the first part of your question (as Aaron has mentioned), there are several MATLAB built-in functions you could use: scatter3, contour3,surf, plot3, etc, However, you should choose the proper function based on your need, and maybe visualization purpose. You may find bunch of good examples in MATLAB:
For the second part, "Yes", you can (again it depends on your intention). Nonetheless, you should be careful about the nature of your data. There are some differences between what meshgrid does and what a 3D matrix can be. If your matrix is something like this:
X Y Z
1 2 3
2 4 6
3 8 12
and, each row represents one certain coordinate points (Mat(1,1),Mat(1,2),Mat(1,3)), you could simply break it down into several vectors and plot them separately. If this is the case (with some variations, because you have mentioned you want to use a couple of 2D data), I think it would be rational if you avoid using 3D matrix and instead work with 2D data (simply in a loop). But, if your data represent a surface (grid vectors) and you want to extract 2D lines, different approach may be taken.