obtain matrix for multiple files
1 回表示 (過去 30 日間)
古いコメントを表示
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
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Software Development Tools についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!