I have an image(mat file) and can access it as a 2D matrix 2*10095. I then made linear algebra work on it to project it onto a plane with normal vector N =[1,2,3]and got the values for the 3D matrix (x,y,z).
How can I plot the 3D matrix with plot3 in Matlab? plot3 takes three arguments (x,y,z) and each column in my matrix has those arguments [x;y;z] but how can I pass all the 10095 columns to plot3 - wouldn't that show me the image "laying" down accordingly to my calculation on the z axis?
I have used this to plot the image when it was as 2D matrix:
plot(T2(1, :), T2(2, :), 'k.','MarkerSize', 1);
If the data is setup in this configuration:
Bottom layer (first layer) →
x
component/value(:,:,1)
Middle layer (second layer) →
y
component/value(:,:,2)
Top layer (third layer) →
z
component/value(:,:,3)
For a smooth/interpolated plot the function
surf()
can be used alternatively.Using MATLAB version: R2019b