how to read text file into table ??

1 回表示 (過去 30 日間)
narimen boucenna
narimen boucenna 2020 年 7 月 16 日
コメント済み: narimen boucenna 2020 年 7 月 21 日
i want to read text file into table but i cant use readtable neither xlsread cz i have matlab 2009 so any suggestions ??

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 7 月 16 日
table() objects did not exist in R2009* so you cannot read into a table.
xlsread() did exist in R2009* . However, if you are not using Windows with Excel installed, then in that release you were limited to pure numeric files.
In your release, it might perhaps have been most appropriate to use textscan()
  7 件のコメント
Walter Roberson
Walter Roberson 2020 年 7 月 17 日
You do not need table() objects, then. You need at most a vector of characters, and a corresponding vector of counts, and you would turn that into a vector of probabilities.
You can fopen()/fread()/fclose() to retrieve the characters from the file, or you can use fileread() to get them. But they will be the same as A, so the only reason to write to a file is because the assignment requires it.
Hint: unique() the character vector. accumarray() the third output of unique().
narimen boucenna
narimen boucenna 2020 年 7 月 21 日
thanx Walter Robenson for ur time and i will try to use your hint

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

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

製品


リリース

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by