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

1 Ansicht (letzte 30 Tage)
  2 Kommentare
Gabriel Mbokoma
Gabriel Mbokoma am 7 Mär. 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

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Image Analyst
Image Analyst am 7 Mär. 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 am 7 Mär. 2023
Try using getframe. See attached demo.

Kategorien

Find more on Image Preview and Device Configuration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by