Matlab coding to show the string in one line
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Andrei Bobrov
2012 年 9 月 13 日
編集済み: Andrei Bobrov
2012 年 9 月 13 日
out = [A{:}];
or
out = cat(2,A{:});
or
out = strcat(A{:});
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!