ensureStructsAssign​able( destination, source )

Ensure two structs are compatible for subscripted assignment
Updated 2 Jul 2018

View License

If you try to do structA(2) = structB, you may get an error saying "Subscripted assignment between dissimilar structures." This function makes the two structures have the same structure by adding extra fields to make them assignable. Missing fields will be assigned 'nan'.

Cite As

Sanjay Manohar (2024). ensureStructsAssignable( destination, source ) (https://www.mathworks.com/matlabcentral/fileexchange/67911-ensurestructsassignable-destination-source), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Programming in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes