Import a vector including strings and numbers

1 回表示 (過去 30 日間)
som
som 2012 年 11 月 7 日
Hi all,
I have a series of data including strings (e.g. stars) and numbers like below:
A= [*0.29 *0.60 *0.54 *0.72
*0.45 *0.62 *0.64 *0.70
*0.37 *0.60 *0.01 *0.70
*0.56 *0.60 *0.85 *0.65
*0.49 *0.63 *0.89 *0.61
*0.48 *0.62 *0.82 *0.70
*0.45 *0.66 *0.76 *0.74
*0.41 *0.74 *0.77 *0.69
*0.49 *0.66 *0.97 *0.74
*0.51 *0.69 *0.55 *0.74
*0.64 *0.72 *0.80 *0.74
*0.44 *0.69 *0.79 *0.83
*0.44 *0.73 *0.44 *0.73];
How can I import this vector?? Thanks
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 7 日
import from what? text file?
som
som 2012 年 11 月 7 日
yes, I want to import vector A from a text file

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

採用された回答

Jan
Jan 2012 年 11 月 7 日
編集済み: Jan 2012 年 11 月 7 日
Or:
fid = fopen('test.txt');
A = reshape(fscanf(fid, '*%g ', Inf), [], 4);
fclose(fid);
  1 件のコメント
som
som 2012 年 11 月 9 日
Thanks a lot

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by