필터 지우기
필터 지우기

how to read NASA AMES FORMAT data

조회 수: 7 (최근 30일)
SChow
SChow 2020년 7월 14일
댓글: Walter Roberson 2020년 7월 16일
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
KSSV
KSSV 2020년 7월 14일
You can read that file using textscan. Read about it.
SChow
SChow 2020년 7월 14일
Thanks but sorry, textscan couldnot read it.
Can you show how textscan is able to read this data?

댓글을 달려면 로그인하십시오.

채택된 답변

SChow
SChow 2020년 7월 14일
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
Walter Roberson
Walter Roberson 2020년 7월 16일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by