1
votes

I have 2 vectors, one call X and enother calls Y. In X I have the x coordinate, and in Y the y coordinates. The first coordinate in X and the first in Y give a point, and so on.. The numbers in each vectors are float, and can be negative and positive.(-29.3, 14.2) If I make plot on them I'm getting a green square.

plot(X,Y,'g');

What I want is to turn both vectors into 1 matrix, and if I will do imshow(Matrix) I will get the same square image.

Doing this:

Matrix = [X;Y;];

Didn't work. It just draw somthing green on the screen. Hope I was clear enough. Thanks All!

1

1 Answers

1
votes

Shlomi, you need to use hist3.

For example:

m=hist3([X' Y'],nbins)

just select the number of bins nbins appropriately so you'll have the grid resolution you want. Then imshow(m) will work.