When I evaluate a range variable in a trigonometric function it works fine. But the problem comes in when I assign this trigonometric function containing the range variable to another variable. I get an error on the range variable that says, "This value must be a scalar or a matrix." The sheet is attached.