필터 지우기
필터 지우기

How to extract data in text file

조회 수: 2 (최근 30일)
chengwei zhang
chengwei zhang 2020년 1월 22일
댓글: chengwei zhang 2020년 1월 22일
Hi guys
I am trying to extract the data inside the text file and i am using:
data=readtable('GeT.txt','Format','%s%s')
which shows me that there are 3 variables but in the file i only see 2. what is wrong with this? Pls help me out
Thx in advance

채택된 답변

Bhaskar R
Bhaskar R 2020년 1월 22일
편집: Bhaskar R 2020년 1월 22일
No need of specifying format(%s) there, MATLAB takes automatically respective data type
data = readtable('Ge single crystal transmission.txt'); % there is empty column(3rd)
data.Var3 = []; % remove 3rd variable because its empty
If you want data as numberic array
data = readmatrix('Ge single crystal transmission.txt'); % numeric array and empty column(3rd)
data(:,3) = []; %remove 3rd column because its nan values(empties)
  댓글 수: 1
chengwei zhang
chengwei zhang 2020년 1월 22일
rly rly big thx bud :). problem solved

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Crystals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by