Students inputting values in table and getting outputs

I am trying to make a table where students type in a value for x and the table gives the students the output. No matter what students type in for the radical function, it always returns undefined. Here is my code:

f = simpleFunction(“sqrt(21 - 2x)”)
g = simpleFunction(“x - 3”)

cellContent(1,2): when isUndefined(this.cellNumericValue(1,1)) “” otherwise ${f.evaluateAt(this.cellNumericValue(1,1))}
cellContent(1,3): when isUndefined(this.cellNumericValue(1,1)) “” otherwise ${g.evaluateAt(this.cellNumericValue(1,1))}

cellContent(2,2): when isUndefined(this.cellNumericValue(2,1)) “” otherwise ${f.evaluateAt(this.cellNumericValue(2,1))}
cellContent(2,3): when isUndefined(this.cellNumericValue(2,1)) “” otherwise ${g.evaluateAt(this.cellNumericValue(2,1))}

cellContent(3,2): when isUndefined(this.cellNumericValue(3,1)) “” otherwise ${f.evaluateAt(this.cellNumericValue(3,1))}
cellContent(3,3): when isUndefined(this.cellNumericValue(3,1)) “” otherwise ${g.evaluateAt(this.cellNumericValue(3,1))}

I have changed the radical function to linear and it works fine so I think it’s something with the simple function feature.

The latex you have for the square root function is not formatted correctly. Try typing the formula you want in desmos, copying it, and pasting it into the CL. You’ll see the difference in how the formatting should look, and that should help.

1 Like

I believe you can use .map for the repeated cellContent sinks, no?