obtain matrix for multiple files
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have this code which reshapes column vectors from the file 'B00049' into 4 different matrices for x y u v now i want to scale this for multiple files in a folder. How can i construct the for loop to process the matrices as for the 1 file
this is the code for 1 file
filename= 'B00049.dat'
delimiterIn= ' ';
headerlinesIn = 3;
A= importdata(filename,delimiterIn,headerlinesIn);
%% Matrices%%%%
c = 214;%columns
r = 134;%rows
x= zeros(r,c);
y= zeros(r,c);
u= zeros(r,c);
v= zeros(r,c);
%% Matrix population
for j=1:r x(j,:) = A.data((j-1)*c+1:j*c,1);
y(j,:) = A.data((j-1)*c+1:j*c,2);
u(j,:) = A.data((j-1)*c+1:j*c,3);
v(j,:) = A.data((j-1)*c+1:j*c,4);
end
now I want to know how to 'for loop' for multiple files in a folder so it processes each one to obtain the 4 matrices for each. Anyone have an idea please
Réponses (0)
Voir également
Catégories
En savoir plus sur Software Development Tools dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!