I studied electrical engineering with a specialisation in acoustics / electroacoustics / signal processing. Currently I am employed by a company which develops and manufactures telecom loudspeakers (microspeakers). I'm doing acoustics research and development there, including electroacoustic simulations and software development.
My private interests include dancing Salsa and developing HighEnd loudspeakers.
I came up with the same "hack" as Barry - this now was already a few years ago... From a programming point of view this is very unaesthetic but it does what it is supposed to do.
I posted it on file exchange as contribution 20972 "copymyobj".
Using this hack is more powerful than any other implementation of a generic copy because it deep-copies also dynamically added properties etc. This is due to reasons which are described by Bobby some 2 postings above.
More than once I complained at The Mathworks that there is no generic function for doing deep copies of classes inheriting from handles - obviously now there is a chance that they are investigating this issue :-)
This file is great, saves lots of work.
But in order to test the buttons result more easily, I replaced all occurrences of the variable 'button' with the new variable name 'canceled' and modified some code lines:
line 93: <button = ;> replaced by <canceled=true;>
line 387: <button = 'OK';> replaced by <canceled=false;>
line 424: <button = 'cancel';> replaced by <canceled = true;>
Now I can call the dialogue ([settings,canceled]=settingsdlg(...)) and then just test with a simple if ~canceled, code, end instead using strcmp for that.
THANKS FOR THIS FILE!