How to save a specific field from struct as mat file

25 visualizzazioni (ultimi 30 giorni)
A.a = 1;
A.b = 2 ;
A.c = 3;
save('new_c', 'A.c')
In Line 4 I'm getting the floowing error:
Error using save
'A.c' is not a valid variable name.
How to do this. Please help.

Risposta accettata

Ameer Hamza
Ameer Hamza il 12 Apr 2020
A.a = 1;
A.b = 2 ;
A.c = 3;
save('new_c', '-struct', 'A', 'c')

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