フィルターのクリア

how to read a numeric data in an array type?

2 ビュー (過去 30 日間)
ramesha
ramesha 2014 年 4 月 9 日
回答済み: Walter Roberson 2016 年 1 月 4 日
dear user
3750 555 10266
3750 555 0
3750 555 0
3750 555 0
3750 555 0
3750 555 0
3750 555 0
3750 555 0
3750 555 0
in the above text file i read data and take three co-ordinate like x,y&z but i want read in the form of a=[xi,yi,...xn,yn]. where i is initial point and n is the last point of x or y
  1 件のコメント
Triveni
Triveni 2016 年 1 月 3 日
Try to use reshape or permute command

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

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 1 月 4 日
fid = fopen('YourFile.txt', 'rt');
datacell = textscan(fid, '%f%f%*f', 'CollectOutput', 1);
fclose(fid);
a = reshape( datacell{1}.', 1, []);

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by