the one of the solutions
% assume you want to change the var V, eg, 1x10 doubles,
% which lives in file MYFILE.MAT
fnam='myfile';
mv=load(fnam);
v=mv.v;
v(1)=10; % <- keep rest of V...
save(fnam,'v');
us
so tell me how can I solve this problem?
thanks,
Darshana Mistry
"us " <u...@neurol.unizh.ch> wrote in message <gpvnbh$5k5$1...@fred.mathworks.com>...
sorry for having misunderstood your OP...
to change one var and keep others, do this
fnam='foo.mat';
whos('-file',fnam); % see what you have...
mv=load(fnam);
mv.v=pi;
save(fnam,'-struct','mv'); % <- save each field of MV as a var
whos('-file',fnam); % tells you, that vars are saved individually...
% for an explanation, see
help save;
us
You could also look into the '-append' option to SAVE.