How can I use the save function in matlab to save a variable in the workspace, which is actually a two dimensional table, into an existing .dat file from which I previously loaded that variable?

2 views (last 30 days)
load ('datos22.dat', '-mat');
for i=1:2:43
datos(:,i)=datos(:,i)+6;
end
save('datos.dat',datos,' -dat')
  2 Comments
PeakyClimber
PeakyClimber on 29 Dec 2017
Thank you but my problem is that I loaded a variable which is composed of of a 46x43 data table from a.dat file, using "load" function with -mat extension. Afterwards I made some changes in such variable table (the "for" function you see above), and then what I want is to overwrite the firstly used .dat file with the modified values and save. There must be something that can be done, my teacher is asking for it.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!