Effacer les filtres
Effacer les filtres

How to save a specific field from struct as mat file

27 vues (au cours des 30 derniers jours)
MB
MB le 12 Avr 2020
Modifié(e) : Ameer Hamza le 12 Avr 2020
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.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Structures 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