Mathematica 9 is now available
Student Support Forum
Student Support Forum: '"Backtrace" expression in a notebook' topicStudent Support Forum > General > Archives > ""Backtrace" expression in a notebook"

Help | Reply To Topic
Author Comment/Response
03/25/12 07:24am

I don't really know how to put this in Mathematica terms, so I will just give an example of what I want to accomplish:

In a notebook in mathematica, I have a number of assignments and ultimately, they lead to a number or an expression which is my "result". This happens when I am approaching a new problem and I test some things out, approaching my result step by step until I have found out how it all works.

In the end, I want to create a general function to calculate this result for me. I create a function f[inputs], and I take all the steps I have taken in the notebook and gather them in this function until it ultimatively represents the calculation made in the notebook to reach the "result" I had in the first place.

Now I was wondering if this purely deterministic and mechanical work of gathering the path of assignments, references and such and making a function out of them can be done by Mathematica. much like in this notebook:
input = Read["file"];
(*-next cell*)
a = input + Sin[3];
(*-next cell*)
b = a + 4;
(*-next cell*)
b (* my result *)

What I want: either a function which I can apply to b and it yields "Read["file"] + Sin[3] + 4"

or a functionality of the mathematica environment which does this on selected expressions much like the way "evaluate in place" works.

Thanks for bearing with me through all this text. Your help is appreciated.

Simon L.

URL: ,
Help | Reply To Topic