Message Boards Message Boards

GROUPS:

Divide two dynamic values and write the answer in numerical form?

Posted 5 months ago
630 Views
|
6 Replies
|
1 Total Likes
|

Consider the following code:

x = 0; y = 0;
a = Dynamic[x = x + 3]; b = Dynamic[y = y + 2];

I need to display the value of

N[a/b]
6 Replies

It's not clear what the question is.

I am sorry, I edit the post.

When we define two dynamic values, say a and b as above, I need to express the operation a/b in numerical form, but N[a/b] does not work !

I wondering to know how we can do this.

Both a and b are expressions with head of Dynamic. Maybe you want to work directly with the values {x,y}? Could be done as follows.

x = 0; y = 0;
Dynamic[x = x + 3; y = y + 2; N[x*y]]

I changed the division to multiplication so that changes in the value would be visible.

Thank you for your help Your suggestion works well for me.

Posted 5 months ago

Maybe something like this will be a littel help.

.inputmaxnumber[max_] := Manipulate[x, {x, 0, max, 3/2*00.1}] // N inputmaxnumber[100]

And here you will just need to enter a max value of max as a number.

Attachments:

Thanks for your help.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract