ensureStructsAssign​able( destination, source )

Ensure two structs are compatible for subscripted assignment

You are now following this Submission

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://au.mathworks.com/matlabcentral/fileexchange/67911-ensurestructsassignable-destination-source), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Programming in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0