how to read the .c file contents from the browsed files by matlab code..?
Mostrar comentarios más antiguos
I am supposed to write a program choose the folder and read the file contents.Inside the folder i will have different types of files.in that i want to read only the files which is having the end name as "_data.c" .
folder_name = uigetdir('','source_code')
folder_name =
C:\Users\tamil\Desktop\Source_code
i have selected the folder with matlab code.but how do i read the file..?
Respuestas (1)
dpb
el 17 de Mayo de 2014
folder_name = uigetdir('','source_code');
c=dir(fullfile(folder_name,'*_data.c')); % return directory list of matching files
for i=1:length(c)
d=importdata(c(i).name);
% do what you need w/ the resulting cell array here
...
end
Categorías
Más información sobre Files and Folders 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!