How to read this mtx file in matlab

59 Ansichten (letzte 30 Tage)
Mojtaba Mohareri
Mojtaba Mohareri am 20 Mai 2021
Kommentiert: Mathieu NOE am 14 Jun. 2021
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.

Antworten (1)

Mathieu NOE
Mathieu NOE am 20 Mai 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 Kommentare
Mojtaba Mohareri
Mojtaba Mohareri am 12 Jun. 2021
Hello. Thank you for your help. I can't attach the mtx file here.
Mathieu NOE
Mathieu NOE am 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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Import and Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by