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.

0 个评论
回答(1 个)
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 个评论
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 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!