Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #16751
| From | xan.mar.cm@gmail.com |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | How to extract the numerical value of a dynamical variable? |
| Date | 2014-04-09 08:14 +0000 |
| Message-ID | <li2vh1$pcu$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
Hello
Could you please help me with following?
How can I get a real number (and not an expression) from a dynamic variable in "manipulate"? (my aim is to use that value in another function as "NonlinearModelFit"
Have a look at this example:
Lini = 1.95;
SumStart = 2750.; SumStop = 3100.;
{Manipulate [ Plot[ {Exp[-(2.97018 10^6 - 4481.87021 [Omega] + 2.53689 [Omega]^2 - 6.38403*10^-4 [Omega]^3 + 6.02659*10^-8 [Omega]^4) * L*10^-4]} , {[Omega], SumStart, SumStop}, PlotRange -> {0, 1}, GridLines -> Automatic, PlotStyle -> {{Red, Thickness[0.004]}}] , {{L, L0}, 0.0, 20, Appearance -> "Labeled"} (* =E9paisseur d'eau en microm=E8tres*) , LocalizeVariables -> False , Initialization -> {(L := Lini)} ] , {L0 = Dynamic[L] // N}; }
If I type (when the cursor's value is put on 13.1) :
In[1]= 5 + L0 + 0.1
I get:
Out[1]= 5.1 + 13.1
a mathematical expression!
I am looking for the corresponding real number 18.2 corresponding to the present value of the cursor!!!
How to get it?
Thanks for your help
Christian
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar
How to extract the numerical value of a dynamical variable? xan.mar.cm@gmail.com - 2014-04-09 08:14 +0000 Re: How to extract the numerical value of a dynamical variable? David Reiss <dbreiss@gmail.com> - 2014-04-10 07:09 +0000
csiph-web