Problem with importdata while retrieving string from txt file.

조회 수: 1 (최근 30일)
sermet
sermet 2014년 2월 2일
댓글: sermet 2014년 2월 2일
%My txt file is trial.txt;
p100 4163603.622 441621.461 1149.353
p101 4163595.878 441621.927 1151.896
p102 4163598.903 441621.752 1150.876
[FileName1,PathName] = uigetfile('*.txt','Select the txt file')
[num,txt1,raw] = importdata(FileName1)
%In this case I need to retrieve num, txt1 and raw but it gives failure because of strings value.
%How can I retrieve and seperate num, txt1 and raw data from trial.txt?
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 2일
편집: Azzi Abdelmalek 2014년 2월 2일
what is the difference between num and raw data?
sermet
sermet 2014년 2월 2일
num is double, raw is cell

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 2일
v=importdata(FileName1)
num=v.data % Your numeric data
text1=v.textdata

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by