Message Boards Message Boards

defining a function out of the results of complicated procedure

Posted 9 years ago

During my program, I do some symbolic calculations and finally the program comes up with a final symbolic matrix. I need to use that matrix as a function so I could evaluate the matrix for different parameters. something like this y = x + z; ss[x, z] := y; ss[1, 2] the result of my program goes into y. then i want to evaluate y for different x and z but it is not working.

POSTED BY: behrooz karimi

Try something like this:

y := x + z;
ss[i1_, i2_] := Block[{x = i1, z = i2}, y];
ss[1, 2]
POSTED BY: Jesse Friedman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract