setfields
SETFIELDS Set structure fields from name/value pairs (Octave name). SOUT = SETFIELDS(S, F1, V1, F2, V2, ...) returns a copy of structure S with the named fields set to the given values. Missing fields are created. MATLAB portable path: S.(f1)=v1; ... or setfield chained. Unmarked MATLAB-mode scripts that never call this name are unaffected. See also GETFIELDS, SETFIELD, FIELDNAMES.