How to add a new field in astruct

1 view (last 30 days)
test=struct('generated_power',genPwr,'Platform_motions',PlatMotions)
How can I add a new field to my "test"-struct between runs?

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 6 Nov 2019
setfield(test,'NewField',1)

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!