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

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -