How to read this mtx file in matlab

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.

Risposte (1)

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 Commenti

Thank you very much for your help. Sorry, I didn't get the code above. Actually, I don't know much about matlab codes. So could you please explain me how I can use the code above for my mtx file? Thanks.
hello
can you share your mtx file ? i can further help you then
Hello. Thank you for your help. I can't attach the mtx file here.
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.

Accedi per commentare.

Categorie

Scopri di più su Files and Folders in Centro assistenza e File Exchange

Richiesto:

il 20 Mag 2021

Commentato:

il 14 Giu 2021

Community Treasure Hunt

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

Start Hunting!

Translated by