MATLAB: How to add a new field in astruct

struct

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

Best Answer

setfield(test,'NewField',1)