matlab - Showing density of something in 2d spacematlab -


i have 3 1 n vectors: x, y , phi. x , y determine position in 2d space , phi(i) amount of particles exist in position(x(i),y(i)). want plot 2d region shows amount of particles in space colors. example, positions in particles concentrated different positions smaller amount of particles. me how can that? answers highly appreciated

%assuming x,y locations positive (otherwise shift) s = max( max(x), max(y) ); map = zeros(s,s);  particle = 1:n     map( x(particle ), y(particle ) ) = map( x(particle ), y(particle ) ) + 1; end  %then can surf map 

plot map using surf or imshow. surf looking for!


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -