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 Ansichten (letzte 30 Tage)
load ('datos22.dat', '-mat');
for i=1:2:43
datos(:,i)=datos(:,i)+6;
end
save('datos.dat',datos,' -dat')
  2 Kommentare
PeakyClimber
PeakyClimber am 29 Dez. 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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Workspace Variables and MAT Files finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by