Filter löschen
Filter löschen

how to make matlab save (filename) command work?

1 Ansicht (letzte 30 Tage)
Loren99
Loren99 am 9 Jun. 2022
Bearbeitet: Stephen23 am 9 Jun. 2022
Hi everyone! When I try to write save(filename) something strange like this happen to my code. The strange thing is that a week ago I was able to use these command without problems. Can anyone help me?
  1 Kommentar
Stephen23
Stephen23 am 9 Jun. 2022
Bearbeitet: Stephen23 am 9 Jun. 2022
"how to make matlab save (filename) command work?"
It does work: you told MATLAB to save the current workspace in a MAT file, and that is exactly what happened.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Voss
Voss am 9 Jun. 2022
Bearbeitet: Voss am 9 Jun. 2022
save saves to a mat file, so what is happening when you do this
save('untitled2.m')
is that a file is created called untitled.m, which has .m extension but .mat format, so when you look at it in the editor you're looking at binary data contained in that mat file.
To save a mat file with .mat extension do this
save('untitled2.mat')
or this
save('untitled2')

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by