ensureStructsAssignable( destination, source )
Version 1.0.0.0 (1.23 KB) by
Sanjay Manohar
Ensure two structs are compatible for subscripted assignment
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 (2026). ensureStructsAssignable( destination, source ) (https://uk.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 LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
