Effacer les filtres
Effacer les filtres

problem to save structura in .mat file

3 vues (au cours des 30 derniers jours)
Luca Re
Luca Re le 9 Juin 2023
Commenté : Stephen23 le 9 Juin 2023
a.w=1;
a.r="ff";
a.v=3;
a.s="a.tst";
save(a.s,'-struct','a')
a=load("a.tst","-mat");
i see 1X1 struct and not as original
  3 commentaires
Luca Re
Luca Re le 9 Juin 2023
Modifié(e) : Luca Re le 9 Juin 2023
I had an analog example and was unable to change the fields
Now problem is solved .thanks
Stephen23
Stephen23 le 9 Juin 2023
"i see 1X1 struct and not as original"
The original is also a 1x1 struct. They look exactly the same to me:
a.w = 1;
a.r = "ff";
a.v = 3;
a.s = "a.tst"
a = struct with fields:
w: 1 r: "ff" v: 3 s: "a.tst"
save(a.s,'-struct','a')
clearvars
b = load("a.tst","-mat")
b = struct with fields:
w: 1 r: "ff" v: 3 s: "a.tst"

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by