Thanks for your quick reply and support.
I would like a simple "+" funtion which combines the values from two similar structs into one. Field names and construction are equal on the inut structs. The structs are typically struct arrays with more than one level of struct arrays.
Looking forward to your next release.
Excellent m file, which simplifies my code a lot.
I wonder if it possible in a simple way to extract variables from a struct array?
Also is there a simple way to concatenate struct arrays with similar field names etc?
It seems you have stumbled upon a name collision issue combined with the issue that Matlab treats calling a command differently whether it is from the command line or within a function. I assume you have a function called 'sigma' in your Matlab's path. I did not find such function in my system so it could be a function you've created or a built-in function if you have toolboxes that I don't have or a different Matlab version. Try using 'which sigma' to find out details on sigma or better yet 'edit sigma' to edit the function. When I write a code I try to follow the practice of naming variables with a case specific name so to avoid collisions with function names or even other variables in my code.
I could also suggest a practice I've recently began using which helps me in debugging and sorting out issues such as this. I added the line 'dbstop if error' in the startup.m file so whenever an error is encountered during a run the debugger breaks in the line of the error. In your case the debugger would have stopped in a new window of the 'sigma' function.
I hope this helps. Cheers.