Matlab coding to show the string in one line
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have data in txt file as shown below.
aaaaaaaaaaaaaaaaaaaaaafffffffff
eeefffffaaaaaaaaaaaeeeeeeeeeeee
now,I have to show the result or ouput as shown below
'aaaaaaaaaaaaaaaaaaaaaafffffffffeeefffffaaaaaaaaaaaeeeeeeeeeeee'
I have writtten a prog.
x=fopen('data.txt','r');%data.txt contains above data
X_t=textscan(x,'%s')
A=X_t{1}
But the output is
A{1} ='aaaaaaaaaaaaaaaaaaaaaafffffffff'
A{2}='eeefffffaaaaaaaaaaaeeeeeeeeeeee'
This is not desired output.Please help............
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 13 Sep. 2012
Bearbeitet: Andrei Bobrov
am 13 Sep. 2012
out = [A{:}];
or
out = cat(2,A{:});
or
out = strcat(A{:});
0 Kommentare
Weitere Antworten (1)
Tinkul
am 13 Sep. 2012
1 Kommentar
Siehe auch
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!