How to create .mat file with changing name
Given variables x and y, I want to store it in a mat file named "bobby." To do this, I would just do save bobby x y. My issue is that my code would change the version of bobby, thus I want to be able to save a .mat file using a variable. I tried this:
x=5 y=20 sf="bobby" save sf x y
The issue is, it saved the .mat file as sf, not bobby. Is there a way to save it using a variable instead of a string literal?