Re: Manipulate - discrete values with names + images.
- From: Jon McLoone <jonm@xxxxxxxxxxxxx>
- Date: Wed, 28 May 2008 02:40:44 -0700 (PDT)
On May 27, 2:14 pm, Karen Bindash <KarenBind...@xxxxxxxxxxxxxx> wrote:
I have two different requirements for Manipulate which I dont see
covered in the Mathematica 6 documentation.
1) First problem.
I'm basically looking for
* A variable to be called 'density'
* The Manipulate control to be labelled with the Greek letter rho.
* Tabs to be labeled "mercuy" and "water"
* Values of density to be 1 or 13.6 depending whether user selects
water (1) or mercury (13.6)
Can this be done?
Manipulate[
myfunction[density],
{{density, 1, "\[Rho]"}, {1 -> "water", 13.6 -> "mercury"}}]
2) Second problem.
I'd like a variable 'vehicle' to have user selectable values of car
and bike. But when 'car' is selected, a picture (car.jpg) is shown,
and if bike is selected, a picture bike.jpg is shown. Is this
possible? Can the contents of the jpeg be stored in the source, so a
binary image does not need to be loaded from disk?
The key option is SaveDefinitions which stores the functions and state
associate in the manipulate without having to execute the code...
car = Import["car.jpg"];
bike = Import["bike.jpg"];
Manipulate[
Switch[type, "car", car, "bike", bike],
{type, {"car", "bike"}}, SaveDefinitions -> True]
I think all of these are on the Manipulate documentation page, but
there are over 100 examples to look through:
http://reference.wolfram.com/mathematica/ref/Manipulate.html
Jon McLoone
http://members.wolfram.com/jonm
.
- Follow-Ups:
- Re: Manipulate - discrete values with names + images.
- From: Karen Bindash
- Re: Manipulate - discrete values with names + images.
- References:
- Manipulate - discrete values with names + images.
- From: Karen Bindash
- Manipulate - discrete values with names + images.
- Prev by Date: Re: math rocks!!!!!!!!!!!!!!!!!!!!
- Next by Date: Re: Manipulate - discrete values with names + images.
- Previous by thread: Manipulate - discrete values with names + images.
- Next by thread: Re: Manipulate - discrete values with names + images.
- Index(es):
Relevant Pages
|