MATLAB Answers

Save workspace output to a file

128 views (last 30 days)
alpedhuez
alpedhuez on 31 May 2018
Answered: Aakash Deep on 31 May 2018
I run a program and output various results to a workspace. Is there anyway to put all the outputs in a workspace into a single file?

  0 Comments

Sign in to comment.

Answers (2)

dpb
dpb on 31 May 2018
>> help save
save Save workspace variables to file.
save(FILENAME) stores all variables from the current workspace in a
MATLAB formatted binary file (MAT-file) called FILENAME. Specify
FILENAME as a character vector or a string scalar. For example, specify
FILENAME as 'myFile.mat' or "myFile.mat".
...

  0 Comments

Sign in to comment.


Aakash Deep
Aakash Deep on 31 May 2018
Hello Alpedhuez,
You can use the
save
command to save multiple workspace variables in a single file. You can do this as follows,
save filename variable1 variable2 variable_n
this will generate a .mat file into your current directory. You can load it back into your workspace by double-clicking the file or using load command.
Hope this helps.
Regards,
ADC

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags

Products


Translated by