Azzera filtri
Azzera filtri

Save and load in same file

3 visualizzazioni (ultimi 30 giorni)
lotus whit
lotus whit il 25 Dic 2017
Modificato: lotus whit il 26 Dic 2017
Could please help me , i have several m1.mat,m2.mat,......mn.mat ; i add new row for m1.mat then save if by typing save m1 or save Workspace , then i repeat these steps for m2 , but when i return back to use m1 , i found it has old values before changing .

Risposta accettata

Walter Roberson
Walter Roberson il 25 Dic 2017
ds = load('m1.mat');
ds.m1(end+1,:)=newdata;
save('m1.mat','ds','-struct')
  3 Commenti
Walter Roberson
Walter Roberson il 25 Dic 2017
save('m1.mat', '-struct', 'ds')
lotus whit
lotus whit il 26 Dic 2017
Modificato: lotus whit il 26 Dic 2017
Thanks it is working

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Structures in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by