Difference between .m and .mat files

What's the difference betwwen .m and .mat files? can a file from .m format be converted automatically to .mat?
Many thanks in advance for your answer!

 Akzeptierte Antwort

Andreas Goser
Andreas Goser am 25 Jan. 2012
Bearbeitet: Stephen23 am 15 Dez. 2015

4 Stimmen

  • MATLAB code is in files with extension .M.
  • MATLAB data is in files with extension .MAT.
Thus, you can't always "convert". But if your MATLAB code just contains variable assignments, yes then you can "convert"
Assuming you have a file testm.m with the assigments
a=1
b=2
then you would convert by running the file and then save a MAT file
testm
save('testmat.mat')

Weitere Antworten (1)

saptesh pandit
saptesh pandit am 13 Aug. 2016

0 Stimmen

how do I provide communication between script and simulink model. And is it possible to run model and script simultaneously.

1 Kommentar

Andreas Goser
Andreas Goser am 16 Aug. 2016
Which is a totally different question and I suggest to ask as a new one.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB Compiler finden Sie in Hilfe-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