A button to select 1,2 or 3

tush shared this question 2 years ago
Answered

I want to create a button which performs this task:

The button changes the value of the number `a`.


`a` is initially set to 1. Clicking the button changes `a` to 2, clicking again changes `a` to 3. Clicking yet again changes `a` to 1. (I.e, cyclic)


After choosing a number, the function f(x) = sin(a * x) plotted beforehand, will be changed according to the value of the variable `a`.

Any help?

Comments (2)

photo
1

Use the scripting command SetValue(a, If(a < 3, a+1, 1)). The function f(x) = sin (a x) will change with it

chris

Files: sine.ggb
photo
1

Fantastic

Thanks very much.

photo
© 2023 International GeoGebra Institute