Problems in opening/importing .asc files with headers.
Show older comments
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 Comment
Mingz Lee
on 17 Jun 2019
Accepted Answer
More Answers (0)
Categories
Find more on String Parsing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!