How to read this mtx file in matlab
Show older comments
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.

Answers (1)
Mathieu NOE
on 20 May 2021
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 Comments
Mojtaba Mohareri
on 25 May 2021
Mathieu NOE
on 25 May 2021
hello
can you share your mtx file ? i can further help you then
Mojtaba Mohareri
on 12 Jun 2021
Mathieu NOE
on 14 Jun 2021
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.
Categories
Find more on Files and Folders in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!