MATLAB: Can any body help me to creat .mat file in current folder

.mat fileneural networksave

When I call one function which is obtained by me, I want to create it in current folder. I am using 'save ' function but it has problem that, it is memorised not only my neural network function but also all of function variable . Is there any choose out of 'save' function to create .mat file ?

Best Answer

I suppose you only want to save a specific variable instead of everything:
If you would like to save only variable, a:
a = rand(1,10)
save('a_save.mat','a')
If you would like to save all variables:
filename = 'save_all.mat';
save(filename)