Import txt file into matlab using programically
古いコメントを表示
I have data in txt file as shown below:
ffffffffffffffffffffffffffff
ffffffffffffffffffffffffffff
01234efefabcdeffffffffffffff
ffffffffffffabcdeabcdeffffff
abcdefabcdefabcdefabcdefabcd
abcdffffffefefefefbabadededf
1234dace56778445dcfacedbebbf
abcdfedfedabce34127432ffedab
now these data i have to take in m file by importing txt file into matlab.For that what matlab code should be written.....
Thanks
4 件のコメント
Jan
2012 年 9 月 11 日
This question is far to general to be answered. Please add any details by editing the question.
Matt Kindig
2012 年 9 月 11 日
It is still not clear what form the data is in. Is the data a continuous string of digits, like you've indicated, or is it separated into numbers by spaces, line breaks, commas, etc.? Can you post the first few lines of the file into your question? Also, can you tell us what your desired output for those lines looks like?
Jan
2012 年 9 月 12 日
And what is the desired output? A String or are these characters 4 Byte hex-encoded signed integers?
Tinkul
2012 年 9 月 12 日
採用された回答
その他の回答 (2 件)
Kevin Claytor
2012 年 9 月 11 日
1 投票
The Documentation has rather extensive help for file opening, reading and saving http://www.mathworks.com/help/techdoc/ref/f16-5702.html#f16-14492. I will direct you to a few in particular;
K
2012 年 9 月 11 日
0 投票
I've used the command textread really successfully with .txt files where the columns of numbers were separated by spaces or tabs. The command looked something like this:
textread('Nameoftextfile.txt','%f %f %f','headerlines',12);
Try searching for textread in the Matlab help to get details for your specific application.
カテゴリ
ヘルプ センター および File Exchange で Data Import and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!