salve one field in the same struct is possible?
Mostrar comentarios más antiguos
example:
A.b=3;
A.c=4;
A.d=6;
save("vv",'-struct','A');
A.d=7;
save("vv",'-struct','A','d'); %%don run correctly
%i dont' want resave A.b A.c ..i want only resave A.d
4 comentarios
John D'Errico
el 24 de Jun. de 2023
A.d is NOT a struct though. It is just a scalar. And you can trivially save a scalar value. So why do you think you need to ave it as a struct?
the cyclist
el 24 de Jun. de 2023
For the sake of other folks -- like me! -- who didn't realize this, the syntax
save("vv","-struct","A")
saves all the fields of the structure A as individual variables.
So, the question is whether one can just "append" d to the file, even though A.b and A.c may have changed.
piero
el 24 de Jun. de 2023
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
