How to add a new field in astruct

1 次查看(过去 30 天)
test=struct('generated_power',genPwr,'Platform_motions',PlatMotions)
How can I add a new field to my "test"-struct between runs?

采纳的回答

Fangjun Jiang
Fangjun Jiang 2019-11-6
setfield(test,'NewField',1)

更多回答(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