How to read this mtx file in matlab

조회 수: 35 (최근 30일)
Mojtaba Mohareri
Mojtaba Mohareri 2021년 5월 20일
댓글: Mathieu NOE 2021년 6월 14일
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