How to change text file to array of type double??

8 ビュー (過去 30 日間)
Ali Ahmed
Ali Ahmed 2014 年 5 月 3 日
回答済み: Image Analyst 2014 年 5 月 3 日
HI.. I'm beginner on Matlab and i'm wanted to convert my data containing 10,000 values in a single row in text file. I have load that file in matlab now I want to convert that file to array of type double. I have applied the following command for that purpose
new data= double('file name')
It has convert the data to type double but reduce it to only 8 values. I can't understand why it convert the 10,000 values only to 8.

回答 (1 件)

Image Analyst
Image Analyst 2014 年 5 月 3 日
Because you just converted a character string, 'file name', to a double of the ASCII values of 'f', 'i', 'l', 'e', and so on. You did nothing whatsoever to read in the contents of the file. Try dlmread().

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by