1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| close all;
clear all;clc;
PathName = uigetdir; % open standard dialog box
c = dir(fullfile(PathName,'*.txt'));
aviobj = avifile('example.avi','fps', 2, 'compression','None');
fig = figure;
N = 100;
methode = 'v4';
for i = 1:numel(c)
a = load(fullfile(PathName, c(i).name));
id = a(:,1);
x = a(:,2);
y = a(:,3);
z = a(:,7);
nd = length(x);
Xmin = min(x);
Xmax = max(x);
Ymin = min(y);
Ymax = max(y);
X = linspace(Xmin,Xmax,N);
Y = linspace(Ymax,Ymin,N);
[X,Y] = meshgrid(X,Y);
Z = griddata(x,y,z,X,Y, methode);
idx(1) = find(X(1,:)<0.045, 1, 'last');
idx(2) = find(X(1,:)>0.065, 1, 'first');
idx(3) = find(Y(:,1)<0.045, 1, 'first');
idx(4) = find(Y(:,1)>0.065, 1, 'last');
Z(idx(4):idx(3),1:idx(2)) = NaN;
Z(idx(3):end,idx(1):idx(2)) = NaN;
hold on
contourf(+X,-Y,Z,10);
contourf(-X,-Y,Z,10);
contourf(-X,+Y,Z,10);
contourf(+X,+Y,Z,10);
axis equal tight
M = getframe (fig);
aviobj = addframe(aviobj,M);
cla
end
close all; % tu peux l'enlever si tu veux fermer tes fenêtres manuelement
aviobj = close(aviobj); |
Partager