How to explain the code below in the loop so I reduce the lines
Show older comments
Hi,
Below code is reading the data from the different folders and csv files and plotting them onto one figure but I want to reduce the code and write into the loop so that loop will follow the path of each folder one by one and plot the data of the different excel files on one graph. you help will be appreciated.
Code:
close all; clear all; clc;
%plot the data for Data_LaserSheet_D
a = readtable('F:\3-PIV_Experimental_Data\Outlet_110\Data_LaserSheet_D\Data_PIV\Data_Vector\Run 13-56-31.Adaptive PIV.6tvk0mbp\Export.6tvk0mbp.000000.csv');
X=a{:,5}/1000;
Y=a{:,6}/1000;
U=a{:,9};
V=a{:,10};
quiver(X,Y,U,V,10);
axis tight
hold on
%plot the data for Data_LaserSheet_C
a1 = readtable('F:\3-PIV_Experimental_Data\Outlet_110\Data_LaserSheet_C\Data_PIV\Data_Vector\Run 15-51-40.Adaptive PIV.6ty83hed\Export.6ty83hed.000000.csv');
X1=a1{:,5}/1000;
Y1=a1{:,6}/1000;
U1=a1{:,9};
V1=a1{:,10};
quiver(X1,Y1,U1,V1,10);
axis tight
hold on
%plot the data for Data_LaserSheet_B
a2 = readtable('F:\3-PIV_Experimental_Data\Outlet_110\Data_LaserSheet_B\Data_PIV\Data_Vector\Run 17-19-03.Adaptive PIV.6ul4ynyv\Export.6ul4ynyv.000000.csv');
X2=a2{:,5}/1000;
Y2=a2{:,6}/1000;
U2=a2{:,9};
V2=a2{:,10};
quiver(X2,Y2,U2,V2,10);
axis tight
hold on
%plot the data for Data_LaserSheet_A
a3 = readtable('F:\3-PIV_Experimental_Data\Outlet_110\Data_LaserSheet_A\Data_PIV\Data_Vector\Run 12-45-51.Adaptive PIV.6tskdx6a\Export.6tskdx6a.000000.csv');
X3=a3{:,5}/1000;
Y3=a3{:,6}/1000;
U3=a3{:,9};
V3=a3{:,10};
quiver(X3,Y3,U3,V3,10);
axis tight
hold on
Accepted Answer
More Answers (0)
Categories
Find more on Variables 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!