MATLAB: Error when calling a function inside of another function

output function calling

I'm very new to matlab function. so sorry if i asked a stupid question. i got an error saying "The expression to the left of the equals sign is not a valid target for an assignment." for the line as:
answer = function2(x,y,z);
in function1. when I run another .m file which call this function1 and this function1 calls function2 like the above. I've tested the function2 at the command line with no error. which returns a (1,3) vector. and in function1, i didn't define the variable "answer". I tried to modify the function2 to make it return 3 output variable with each being a scalar and even reduce the function2 output to only one scalar output, it still gave the same error. could anybody give me some help? I really appreciate that.

Best Answer

In orbit, line 16, you open a { and close } before the end, last line. Remove them.
Then variables r0 and a are not defined anywhere in the function.
Oleg