How to read this mtx file in matlab

36 ビュー (過去 30 日間)
Mojtaba Mohareri
Mojtaba Mohareri 2021 年 5 月 20 日
コメント済み: Mathieu NOE 2021 年 6 月 14 日
Hello.
How can I read the following mtx file in matlab? The main file is MatrixMarket format.
I don't know much about matlab codes. Thank you so much in advance.

回答 (1 件)

Mathieu NOE
Mathieu NOE 2021 年 5 月 20 日
hello
this is a txt file with 3 columns and 1 header line
see example below
% demo
clc
clearvars;
% % load data
% [outdata,head] = readclm('myfile.mxt',3,1);
% alternative
fid=fopen('myfile.mxt');
e=textscan(fid,'%f %f %f','headerlines',1);
outdata=cell2mat(e);
  4 件のコメント
Mojtaba Mohareri
Mojtaba Mohareri 2021 年 6 月 12 日
Hello. Thank you for your help. I can't attach the mtx file here.
Mathieu NOE
Mathieu NOE 2021 年 6 月 14 日
What is the issue ? if it's related to the file extension, you can change the extension to .txt or .m , it should be accepted.

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

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by