Save function doesn't do anything

I am trying to save variables off as a .mat file using the save function, but no matter what I do, the function doesn't do anything. I would include an example of my code, but I have tried it every which way and still nothing. Even copy and pasting examples from the mathworks page doesn't work. It's as if nothing even happens. The command executes almost imediately and there is no file to be found, and trying to load the file back in throws an error saying the file doesn't exist.

Antworten (1)

Steven Lord
Steven Lord am 26 Jun. 2020

0 Stimmen

Let's make sure you're calling the correct version of the save function. What does this command show?
which -all save

4 Kommentare

Joshua Morey
Joshua Morey am 26 Jun. 2020
Thanks for your response! I get this;
C:\Users\Josh\Documents\MATLAB\save.m
C:\Program Files\MATLAB\R2018b\toolbox\matlab\winfun\@COM\save.m % COM method
C:\Program Files\MATLAB\R2018b\toolbox\simulink\simulink\@slxPackager\save.p % slxPackager method
C:\Program Files\MATLAB\R2018b\toolbox\mbc\mbctools\@mdevproject\save.m % mdevproject method
C:\Program Files\MATLAB\R2018b\toolbox\mbc\mbcview\@cgproject\save.m % cgproject method
C:\Program Files\MATLAB\R2018b\toolbox\sl3d\sl3d\@vrworld\save.m % vrworld method
built-in (C:\Program Files\MATLAB\R2018b\toolbox\matlab\general\save) % Shadowed
Joshua Morey
Joshua Morey am 26 Jun. 2020
Just to be clear, I am actually using R2018b. I put in a later version into the dropdown box in my question. Not sure if you can see that and if its relevant.
Walter Roberson
Walter Roberson am 26 Jun. 2020
You need to delete or rename C:\Users\Josh\Documents\MATLAB\save.m as that is interfering with using the Mathworks save()
Joshua Morey
Joshua Morey am 26 Jun. 2020
Oh I see. I can't believe I created a function with the name save! Thank you so much!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Entering Commands finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2018b

Tags

Gefragt:

am 26 Jun. 2020

Kommentiert:

am 26 Jun. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by