how to read NASA AMES FORMAT data

I havea data with '.nas' extension (NASA AMES FORMAT). Is there a way to read it. I tried readtable and dlmread. None would work.
Please see the data attached as .zip
an update: see the solution in 'answers'

4 Comments

you can zip it and attach..
SChow
SChow on 14 Jul 2020
Edited: SChow on 14 Jul 2020
Thanks! attached
You can read that file using textscan. Read about it.
Thanks but sorry, textscan couldnot read it.
Can you show how textscan is able to read this data?

Sign in to comment.

 Accepted Answer

Okay,
Matlab cannot read .nas files, so one needs rename the .nas files to .txt (or similarly suitable extensions), and then read the .txt files using textscan
See below for an example
filename=('pwd')
FID=fopen(filename);
datacell = textscan(FID, '%f%f%f%f', 'HeaderLines', 53, 'CollectOutput', 1); %%%removing the first 53 lines that are headers
data=cell2mat(datacell)
fclose(FID);

1 Comment

no, when you fopen you can give any file name. fopen does not use the file name to identify the type of the file in any way.

Sign in to comment.

More Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Asked:

on 14 Jul 2020

Commented:

on 16 Jul 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!