MATLAB: Vector Error when plotting

3d scatter plotvector length

I am trying to convert an image into a 3D scatter plot defined by RBG (XYZ). I get an error that vectors must be of same length.
I plotted the values into a matrix, then attempted to plot it.
c = RBG difference of values between 2 images
x=c(:,:,1); %red channel
y=c(:,:,2); %green channel
z=c(:,:,3); %blue channel
scatter3(x,y,z)
any help is appreciated.

Best Answer

scatter3(x(:),y(:),z(:))
Related Question