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.
Thank you. Regarding your questions, first, I can think of several ways to extract variables from a struct array. They differ in complexity, both in the implementation in the code and the functionality. Could you elaborate how you would like to use this?
Second, I written a simple function to do this and I will upload it shortly. I would send a link to it here once it is published.
Just one suggestion, in case of calling the function with filenames without a full path the call fails if these files are not in the system path. How about adding support to this case by identifying it and building the path using "which" function?
Thanks for the submission.
I found this after I have thought of creating one myself and indeed it is convenient.
I have a suggestion - include the switch "/select" in the command line to get: 1) the file or directory is selected for convenience. 2) you can call explorer.exe with a full file name path since the file would not be opened.
In addition, I added the switch "/e" also for the default case to open the windows explorer with its default view.
Thanks for the submission.
I encountered the exact same name collision problem that Christian Dorion mentioned in his comment below. If I unpack a structure in a function, and one of the resulting variable names is also a function name (it was "ngrid" in my case), then Matlab interprets the variable name as a function call. The strangest think is that if I do a "who" or "which" within the function, then Matlab correctly reports that ngrid is a variable. But then it fails to interpret it correctly. I have a very hard time coming up with an explanation for this behavior. Anyone?