Message Boards Message Boards

[✓] Dynamically change the value of a variable in text mode?

GROUPS:

Hello

I don't know if the title of the question reflects what I need so please feel free to change it (if possible).
I am writing a notebook with lots of texts (command 7) in which I explain how I have come up with a solution to a problem. In one of text parts I wrote

In order to calculate the frequency, I need to know that value of zeta. For zeta=VALUE, the frequency is VALUE.

I don't want to copy and paste the values every time I change the frequency. I know that there is a way to dynamically change them since I did that in the past thanks to the help of David Park, but unfortunately I could not find the email where he explained how to do it. Can you help me, please?

Many thanks

Ed

POSTED BY: Eduardo Mendes
Answer
21 days ago

Ed,

You can do this by typing your text and enter "Dynamic[variableName]" (where variableName is what you want updated). Next select the "Dynamic[variableName]" and right click and do "Create Inline Cell". Select it again and right click and do "Evaluate in Place".

Now the text will change dynamically.

Regards,

Neil

POSTED BY: Neil Singer
Answer
21 days ago

Neil,

Many thanks. It worked but I have to say that it took more than a couple of attempts. I remember having the same problem a few years ago. It seems that despite Mathematica new versions, the problem persists.

Regards

Ed

POSTED BY: Eduardo Mendes
Answer
21 days ago

Group Abstract Group Abstract