image thumbnail

ensureStructsAssign​able( destination, source )

version (1.23 KB) by Sanjay Manohar
Ensure two structs are compatible for subscripted assignment


Updated 02 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 (2022). ensureStructsAssignable( destination, source ) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!