Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Importing txt file using the importdata comand
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Friedrich
el 17 de Abr. de 2013
Editada: Friedrich
el 17 de Abr. de 2013
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
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!