How to plot all the graphs from different folder and save them in a different folder by name of folder
Mostrar comentarios más antiguos
Hi,
I have 44 folders in the path below and each folder have 1 excel file. Is there a way I can change the code below in a way that it will go into folder by folder and plot the graph using the data in that folder and save the graph in .emf format by the folder name in the path folder. Path is shown below as well as the code I am using. It is basically going to take me alot of time by doing one by one. I am also attaching the picture which will show folder names
Path where all the folders are: F:\3-PIV_Experimental_Data\Outlet_110\Data_LaserSheet_D\Data_PIV\6-VectorSatistics\PlotOverLine
Current Code: (Basically going one by one into folder and changing the path each time to save the graph)
files = ['F:\3-PIV_Experimental_Data\Outlet_110\Data_LaserSheet_D\Data_PIV\6-VectorSatistics\PlotOverLine\Run 13-33-42.Profile Plot.71gpvfq7\Export.71gpvfq7.000000.csv'];
a = readmatrix(files);
length=a(:,2);
U_x=a(:,11);
U_y=a(:,12);
U_m=a(:,25);
plot (length,[U_x,U_y,U_m],'-');
%Chart Representation
title('Velocities Across VFC (Below Outlet)');
xlabel('Distance(mm)');
ylabel('Velocities (m/s)');
legend('Velocities in x-direction','Velocities in y-direction','Resultant-Velocities')
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!