How to save a specific field from struct as mat file

26 次查看(过去 30 天)
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.

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by