I'm not entirely sure how to explain this but here is the question:
My main issue is I don't know how to use eval when using a user-input trigonometric function. (I don't really need help with the graphing part).
This is my attempt:
n = input('Enter a positive number n: ');x = linspace(0, n, 1000) trigfunc = input('Enter a trigonometric function: ', 's'); eval('trigfunc(x)')
Best Answer