# I want to use contourf function to plot 2d velocity data

5 views (last 30 days)

Show older comments

I have the x,y and corersponding velocity components u and v as a matrix data. I want to use this matrix data to plot a contour of velocity.

I went tried already using the Matlab database but I don't get epected results. It is hard to interpret the code given in the database, do if anyone can help to relate the code with the velocity data I have would be a big help.

##### 3 Comments

Star Strider
on 13 Jul 2022

### Accepted Answer

KSSV
on 13 Jul 2022

Let u,v be your velcity matrices.

w = sqrt(u.^2+v.^2) ;

figure(1)

pcolor(x,y,w) ; % if throws error, transpose w

colorbar

shading interp

figure(2)

contourf(x,y,w)

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!