So the issue is that plot3 takes either a vector or a 2d matrix. Since you are plotting it as points you do not actually need to make your x,y, and z 3 dimensional. If you wanted you could have them as one long vector. So, to fix your issue you can do a few things. First, change your plot3 to
However, plotting this many times in a loop is extremely slow. Instead, after the loop you can do this
However, right now, your code will create a cylindrical shell at z = 0 and not have any height to it. This is because you are overwriting your z vector with zeros. I would suggest changing those names so you can have it be the proper height.