필터 지우기
필터 지우기

Reaching a specific data in txt file

조회 수: 1 (최근 30일)
googo
googo 2013년 5월 15일
Hello,
suppose I have the file bbb.txt:
date intrest profit loss
24/4/2013 5 232 3232
23/4/2013 6 4224 233
>> Data = importdata('bbb.txt');
>> Data
Data =
data: [2x3 double]
textdata: {3x4 cell}
How can I reach a specific data? Suppose I want the first date or the number 5 in the first row. Thank you!

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 15일
y=Data.data;
y(1,1)
  댓글 수: 2
googo
googo 2013년 5월 15일
How can I change all the data to be from the type of double? Thank's.
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 15일
z=Data.textdata
d=datenum(z(2:end,:),'dd/mm/yyyy')
out=[z y]

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

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by