For example, I defined a user function with a module and what this function does is take the values of two global variables ga
and gb
and write another two global variables gsum
and gdiff
with their sum and difference, respectively. How can I define a user function in the form
fun[a_, b_, sum_, diff_] := Module[ ...]
so that I can get gsum
and gdiff
written with the correct values when I call this user function by
fun[ga, gb, gsum, gdiff]
Assume that ga=10
and gb=5
.
I guess another way to put my question is, how to define a user function with not only input arguments, but also output arguments?
AppendTo
0_o $\endgroup$