So I want to be able to import an image (of stars in the sky), and make a 3D plot of the pixel intensity, so that the stars are easily identifiable as "spikes" in the surface.
I've got this code that other's says should work:
J = imread('IMG_1442.jpg');
I = imresize(J,.2)
[x y]=meshgrid(1:size(I,1), 1:size(I,2));
axis tight; colormap gray
But whenever I run it I get the following error:
Error using scatter3 (line 94)
X, Y and Z must be vectors of the same length.
Error in image_test (line 4)
(The reason I resize the image is because it is extremely large. I've attached a compressed version of the file so that you can see what I'm working with)