Commit a7863271 authored by Jérémy Baudry's avatar Jérémy Baudry

nettoyage

parent fdf7e180
clear all;
close all;
x=ncread('simulation1.nc','x_axis');
t=ncread('simulation1.nc','time');
om=ncread('simulation1.nc','omega');
spectre=ncread('simulation1.nc','Spectrum');
Dave=ncread('simulation1.nc','Dave');
Dmax=ncread('simulation1.nc','Dmax');
f=om/(2*pi);
E=reshape(spectre(end,end,:),length(om),1);
Ei=reshape(spectre(30,:,:),length(x),length(om));
E1=reshape(spectre(1,1,:),length(om),1);
figure(1)
cmap=rand(length(t),3);
w = waitforbuttonpress;
for i=1:length(t)
figure(1)
sp=reshape(spectre(i,:,:),length(x),length(om));
h=mesh(f,x,sp);
axis([min(f) max(f) min(x) max(x) 0 max(E1)])
xlabel('Frequency [s^{-1}]')
zlabel('Energy')
ylabel('x [km]')
pause(0.1)
end
for i=1:length(om)
EE(i)=sum(Ei(:,i));
end
figure
plot(E1)
hold on
plot(EE,'r')
for i=1:length(t)
E2=reshape(spectre(i,:,:),length(x),length(om));
m0(i)=sum(sum(E2))/sum(E1);
end
figure
plot(t,m0)
figure
plot(x,Dmax,'color','r')
hold on
plot(x,Dave,'--b')
grid on
xlabel('x [km]')
ylabel('Floe size [m]')
legend('Dmax','<D>')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment