Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Importing txt file using the importdata comand
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
*1: *
I wrote a function that does some manipulations over a vector strings. Now, I want to apply it on text files.
So let's assume XXX.txt is :
hello world
hello world world
hello world world world
So I wrote:
A = importdata comand ('XXX.txt')
when I run A I get :
A =
'hello world'
'hello world world'
'hello world world'
Now, I want it to be treated as 3 separated vectors of chars. How can I do it? or better question is how to get to one of the vectors? For example: V1 = 'hello world' and V1(1,1)=h
2:
When I tryed to run text files with a lot of text I received this message:
A = importdata('a_lot_of_text.txt')
A =
[1x2568 char]
what does it means? and the first question refers to this also.
Thank's!
댓글 수: 2
Friedrich
2013년 4월 17일
편집: Friedrich
2013년 4월 17일
When I import the xxx.txt i get what you want right away:
>> A = importdata('XXX.txt')
A =
'hello world'
'hello world world'
'hello world world world'
>> A{1}
ans =
hello world
>> A{1}(1,1)
ans =
h
>> A{1}(1,1:3)
ans =
hel
It seems like that a_lot_of_text.txt has a different format than xxx.txt
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!