How to import data from multiple different name text file?
Mostrar comentarios más antiguos
I have about 2380 txt files data starting with file name "lineScan__2017_11_27_17_19_18" and ending with "lineScan__2017_11_28_12_25_59". the files were named according to date and time. "2017_11_27" represents the starting date and "17_19_18" indicates the starting time. I want ti import them into matlab but got this error "unable to open file"
I will appreciate your help to resolve this issue.
Here is the code i wrote:
close all;
close all;
%need the axial step size
Axstep=2.5;
Axlines=2380;
Path = 'C:\Users\asay0001\Google Drive\all data';
Data = zeros(33600,Axlines);
for i = 1:Axlines
DataTemp = importdata(strcat(num2str(i),'.txt'));
Data(:,i) = DataTemp(:,4);
end
Steps = DataTemp(:,1);
Axsteps=[1:Axlines]*Axstep;
figure; plot(Steps,Data(:,[1:Axlines])); grid on;
%need the lateral step size
Latstep=Steps(2)-Steps(1);
[x y,z] = meshgrid([-3200:2.5:-2602],[325:2.5:325],[-800:100:800]);
surf(x,y,z,Data')
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Text Files 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!