Problems in opening/importing .asc files with headers.
Mostrar comentarios más antiguos
Dear all,
Does anyone has the idea of opening such an .asc file? I am facing some problems of opening .asc files by codes. I tried the fopen function and the fread function, I cannot get rid of the headers and the matrix values become very ridiculars. And I also tried with the importdata function, I cannot get rid of the headers and all the data becomes one-column cell-type variables. My matlab version is R2017a. And I attached the data in the zip-file. Thanks in advance!
%% Test with the importdata
filepath = 'C:\Ming\Ming Research Labwork\Coding\20190617test\';
filename = strcat('irdata_001.asc');
fid = importdata([filepath filename], '\t');
%% Test with the fopen and fread.
filepath = 'C:\Ming\Ming Research Labwork\Coding\20190617test\';
filename = strcat('irdata_001.asc');
fid = fopen([filepath filename], 'r', 'n');
A = fread(fid,'double');
1 comentario
Mingz Lee
el 17 de Jun. de 2019
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre String Parsing 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!