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 visualizaciones (últimos 30 días)
load ('datos22.dat', '-mat');
for i=1:2:43
datos(:,i)=datos(:,i)+6;
end
save('datos.dat',datos,' -dat')
  2 comentarios
PeakyClimber
PeakyClimber el 29 de Dic. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by