a question about command:"save" in MATLAB

Status
Not open for further replies.

mro83

Member level 5
Joined
Oct 6, 2004
Messages
85
Helped
11
Reputation
22
Reaction score
4
Trophy points
1,288
Location
Mashad
Activity points
758
matlab save argument must contain a string

Hi all
I wanna save whole workspace of MATLAB with the name containing the value of variable:x, so I write:
save( ['workspace_for_x=',num2str(x),'.mat'])

My question is:
If I want to save just value of some particular variables ( for example a1 and a2) in a simimlar manner, What should I write?

If I write :
save( ['Variables_for_x=',num2str(x),'.mat'], a1,a2)
here arises the MATLAB error:
??? Error using ==> save
Argument must contain a string.

Please let me to know ur comments..
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…