Hello everyone,
I want to remove commas between each letter and read the text file for example as follows:
a='matlab'
dlmwrite('a.txt',a)
dlmread('a.txt',a)= m,a,t,l,a,b
But I want the result to be shown as =>matlab
Any help would be appreciated.

4 件のコメント

Rik
Rik 2018 年 7 月 19 日
I suspect setting the Delimiter would solve this. Did you read the doc?
madhan ravi
madhan ravi 2018 年 7 月 19 日
編集済み: madhan ravi 2018 年 7 月 19 日
I also tried
dlmread('a.txt',',')
didn’t work out either
Image Analyst
Image Analyst 2018 年 7 月 19 日
Please attach your data.txt file. I need to see if the m, a, t, etc. are letters or numbers. For example is it really 1,2,4456,876 that you really want to become a character string '124456876', or a number 124456876, which might not be possible depending on how many digits and decimal points there are.
madhan ravi
madhan ravi 2018 年 7 月 19 日
Sir ,
The file consists
M,A,T,L,A,B
I just want to read the above text file as MATLAB without commas

サインインしてコメントする。

 採用された回答

KSSV
KSSV 2018 年 7 月 19 日

1 投票

a = 'MATLAB' ;
dlmwrite('data.txt',a,'delimiter','')

2 件のコメント

madhan ravi
madhan ravi 2018 年 7 月 19 日
編集済み: madhan ravi 2018 年 7 月 19 日
When I type
dlmread('data.txt')
It doesn’t work unfortunately.
KSSV
KSSV 2018 年 7 月 19 日
Read https://in.mathworks.com/help/matlab/ref/dlmread.html, you need to specify positions to skip the text.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

タグ

質問済み:

2018 年 7 月 19 日

コメント済み:

2018 年 7 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by