How to read this mtx file in matlab

32 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Workspace 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