I appreciate the feedback. We tracked down the problem. It's odd. In my psuedocode above, x5 is actually a variable called "info." It's a structure that is imported from another file. When calling TimeCalculations(....,info,...) in the script, Matlab must do something, I'm not sure what, but it doesn't pass the data structure "info" in. Instead, it calls the Matlab built-in function, info(). However, when I copy and paste the code into the command window, Matlab passes in the correct structure. Interestingly, I also couldn't assign the info structure to another variable and try to pass that in; that also resulted in an error. In the end, the only solution I found was to execute the code as follows:
Now it works. Why I had to go this route, I don't understand. If anyone knows why Matlab evaluates the line differently depending on if it's in the m-file or the command window, I'd like to know.