next up previous contents
Next: displacement histogram: Up: Matlab programmes for image Previous: Reading a raw image:   Contents


Reading a velocity field (.u or .v)

clear all;

%Lecture of a binary file .u

nx=50; %number of grid points in x

ny=50; %number of grid points in y

image=input('Please give the image name ending by .u :','s');

fid=fopen(image, 'r');

A=fread(fid, 1, 'int');

B=fread(fid,'float');

Nb_points_tot=A;

NB=length(B);

xx=B(1:4:NB); % x-coordinate

yy=B(2:4:NB); % y-coordinate

uB=B(3:4:NB); % radial velocity

vB=B(4:4:NB); % tangential velocity

fclose(fid);

U(1:nx,1:ny)=0;

a=1;b=ny;

for i=1:nx

U(i,1:ny)=uB(a:b)'; %build a matrice nx*ny

a=a+nx; b=b+ny;

end;

figure(1)

contourf(U,10); % example of representation of the radial velocity



Joel Sommeria 2003-02-14