How to append a variable to a .mat file?

12,684

If you look at the save() function documentation, there is a form of the save command that might help:

save(filename, ..., '-append')

The help for this form says:

save(filename, ..., '-append') adds new variables to an existing file. You can specify the '-append' option with additional inputs such as variables, '-struct' , format, or version.

Share:
12,684
jhlu87
Author by

jhlu87

Trader learning to program

Updated on July 14, 2022

Comments

  • jhlu87
    jhlu87 almost 2 years

    If I already have a .mat file with the variables x and y, is there a way to use the save command to add another variable z to the .mat file without having to explicitly state the variables x and y in the save command?