How to read in a Matrix from an .mtx file?

25 ビュー (過去 30 日間)
Michael Berner
Michael Berner 2017 年 1 月 31 日
コメント済み: Jayaram Theegala 2017 年 2 月 2 日
Hello everyone,
I need to read in a matrix from a .mtx file. I know that the command 'readmtx' exists, but I don't know how to define where the matrix is exactly in the document. There are several lines above, which need to be skipped.
Thanks in advance, Michael
  2 件のコメント
Jan
Jan 2017 年 1 月 31 日
編集済み: Jan 2017 年 1 月 31 日
You have to find out, what "several" exactly means. Neither Matlab nor the forum can guess this reliably. Perhaps you can post an example?
Jayaram Theegala
Jayaram Theegala 2017 年 2 月 2 日
I agree with Jan Simon. Using the "readmtx" function you can read the entire file (it contains the "several lines" and the matrix you are interested). Once you have the "several" answered, you can find out its size and separate the matrix you are interested from the entire data.

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by