MATLAB: Loading and using a .MAT file

.mat load save

I am having a great deal of trouble saving a .MAT file to a destination on our D drive at the end of one function and retiriving it and loading its contents into the workspace at the start of another function. I am using
save D:\Temp_folder;
then at the beginning ….
load D:\Temp_folder
Do i need to use an append function?
Thank you for your help

Best Answer

Try like this:
save('D:\Temp_folder\MyVars')
load('D:\Temp_folder\MyVars')
Also you can use the save function with appended strings like this
save(['D:\Temp_folder\') 'MyVars'])