Works fine, thanks. Of course I have one suggestion!
Instead of requiring that the structure name be passed separately as a string, get the name by calling inputname(1). I found that useful little trick here on File Exchange, in the structstuct function.
04 Oct 2011
No need to explicitly specify the root name of the structure (thanks to nan's suggestion)