i extracted frames from the video but the frames are not showing in full in the folder I saved them.

2 visualizaciones (últimos 30 días)
  2 comentarios
Gabriel Mbokoma
Gabriel Mbokoma el 7 de Mzo. de 2023
Here is my code:
clear
close all
set(groot,'defaulttextinterpreter','latex');
set(groot, 'defaultAxesTickLabelInterpreter','latex');
set(groot, 'defaultLegendInterpreter','latex');
fn='wave_equation_2D.h5'
pause on
pos = h5read(fn,'/pos');
for i=1:999
num = int2str(i);
eval(['E',num,'=','h5read(''',fn,''',','''/step',num,'/E''',');']);
end
for i=1 : 999
num = int2str(i);
var=eval(['E',num]);
plot3(pos(:,1),pos(:,2),var,'.-');
tri = delaunay(pos(:,1),pos(:,2));
plot(pos(:,1),pos(:,2),'.');
[r,c] = size(tri);
h = trisurf(tri,pos(:,1),pos(:,2),var);
axis vis3d;
caxis manual;
caxis([-0.3 0.3]);
axis equal
xlim([-1 1]);
ylim([-1 1]);
zlim([-0.4 0.4]);
axis on;
l = light('Position',[-20 -15 29]);
lighting phong
shading faceted
xlabel('$x$');
ylabel('$y$');
zlabel('$z$')
pause(0.001);
filename = ['image ' num];
print(filename,'-dpng');
end

Iniciar sesión para comentar.

Respuestas (2)

Image Analyst
Image Analyst el 7 de Mzo. de 2023
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
In the meantime, see how I did it in the attached demo.

Image Analyst
Image Analyst el 7 de Mzo. de 2023
Try using getframe. See attached demo.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by