File Exchange

image thumbnail

Structure Overwrite and Merge

version 1.0 (1.62 KB) by

To Overwrite and Merge two structures. Both overwrite and Merge are optional.

0 Downloads

Updated

View License

This is a funtionality I required for my GUI simulator where the user enters parameters in GUI and these parameters over-ride the default ones of the simulator. Merge funtionality adds these parameters as 'extra'. I can not afford to have bugs in this one (ofcourse :)). So if you kindly find any bugs let me know. I have made it general so other users can use it if they require. Also its case-sensitive which is annoying.

Comments and Ratings (2)

This submission could (should?) be made recursive to handle the case when the fields of the top-level structures are themselves structures.

Jeff Anderson

Did exactly what I needed to do. Thank you!! Great for a gui that has a lot of parameters. You can create a default structure in the function then pass it just the user overwrites and use this function to merge and make the correct overwrites!

MATLAB Release
MATLAB 7.8 (R2009a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video