how can I process several files
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Mostafa Elsayed
el 19 de Jul. de 2023
Comentada: Mostafa Elsayed
el 19 de Jul. de 2023
Helloe everyone,
please, how can I process all data using loop to avoid repeat text and also to plot all of their figures (2D and 3D)?
the code I use:

0 comentarios
Respuesta aceptada
VBBV
el 19 de Jul. de 2023
Editada: VBBV
el 19 de Jul. de 2023
You can use a for loop
tiledlayout('flow')
for k = 1 : 7
D = sprintf('PIVlab_%1d.mat',k)
hResult = surfheight(D,h0,H,n,[X0 Y0],'verbose','mask','nosetzero');
nexttile
imagesc(hResult.x,hResult.y,hResult.w)
end
4 comentarios
VBBV
el 19 de Jul. de 2023
Editada: VBBV
el 19 de Jul. de 2023
Ok, if you want to generate figures separately for 2D & 3D then, you can use for loop counter in figure function
for k = 1 : 7
D = sprintf('PIVlab_%1d.mat',k)
hResult = surfheight(D,h0,H,n,[X0 Y0],'verbose','mask','nosetzero');
figure(k);
imagesc(hResult.x,hResult.y,hResult.w);
cmap1 = colormap('jet');
c1 = colorbar;
figure(k+1);
surf(X,Y,hResult.w.','FaceAlpha',1,'EdgeColor','interp')
cmap2 = colormap('jet');
c2 = colorbar;
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Block Libraries en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



