I have the following code:
PopupMenu[Dynamic[choose], {al, bl, cl}]
and
vin1 = Dynamic[choose]
then, I would like to use such value in a conditional expression If:
If[vin1==al, 3 x + 2, 6 y]
But only vin1 is automatically updated. If doesn't work. How can I solve this?
Ifmanually later or automatically? – Kuba Dec 10 '18 at 14:34PopupMenu[Dynamic[choose], {al, bl, cl}]and thenvin1 = Dynamic[choose]. FurthermoreIf[vin1 == al, al + bl, cl + bl]. ButIfdoesn't work. – Gae P Dec 10 '18 at 14:45vin1 = chooseit works. If you want everything to be connected in some kind of gui then you need to explain what do you expect and when. But for Shift+Entervin1=chooseis enough. – Kuba Dec 10 '18 at 14:49"al"instead ofal, as well as forblandcl, in the definition of PopupMenu and inIf– Gae P Dec 11 '18 at 11:21Dynamic["al"] == "al"– Kuba Dec 11 '18 at 11:27PopupMenu[Dynamic[choose],{"al","bl","cl"}and thenIf[chhose== "al", 3 x + 2, 6 y]– Gae P Dec 11 '18 at 12:03Dynamic, great, btw, use===to compare arbitrary expressions. – Kuba Dec 11 '18 at 12:09