Reading and Analysis of asc files...

32 ビュー (過去 30 日間)
Asad Ali Baig Changazi
Asad Ali Baig Changazi 2015 年 5 月 23 日
コメント済み: Walter Roberson 2015 年 5 月 23 日
Hello, I am working on my internship and i have to read .asc file in MATLAB and then make analysis on it. Please guide me how can i read the file in MATLAB and if i want to extract a specific row or column value how it is possible???
  1 件のコメント
per isakson
per isakson 2015 年 5 月 23 日

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

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 5 月 23 日
.asc is used for:
  • actionscript
  • autodesk
  • PGP ASCII Armored File
  • LTspice Circuit Schematic
  • ArcGrid and ESRI Grid GPS files
  • Adobe Flash
  • Atlantis Spellchecker
  • WinAmp media file
I do not believe it is legally possible to write code that can read all of those, as I believe that at least two of those are proprietary formats. Also, the concept of "row" and "column" is difficult to apply to some of those files.
I think you are going to have a difficult time writing code to meet the given requirements.
  2 件のコメント
Asad Ali Baig Changazi
Asad Ali Baig Changazi 2015 年 5 月 23 日
編集済み: Asad Ali Baig Changazi 2015 年 5 月 23 日
https://www.dropbox.com/s/vxj9eksuecnojiv/new.asc?dl=0 Dear here is a file link which i want to analysis in MATLAB. This is comma seperated file, i have other option also to make separation in tabular form, space and semicolon form..
Walter Roberson
Walter Roberson 2015 年 5 月 23 日
fid = fopen('new.asc', 'rt');
C = textscan(fid, '%s%s%f%f', 'Delimiter',',', 'HeaderLines', 1);
fclose(fid);
Now, column #K is C{K} and row #J of column #K is C{K}{J} for column 1 or column 2 (the strings) or C{K}(J) for column 3 or column 4 (the numbers).
col1 = C{1};
col2 = C{2};
col3 = C{3};
col4 = C{4};
col4(17) %row 17 column 4

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

カテゴリ

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