Essentially, I would like to create a function that is very similar to fplot(), where I can enter an expression, and a power I would like to raise it to. The range of x-values it will be plotted for will be constant at x=[-5,5]. Here is my latest attempt that has not worked:
function [ ] = nthDegree( funcDef, n )
syms x ;
f = funcDef ;
y = matlabFunction(f)
Y = y.^n ;
Every attempt has resulted in the error message. Here is one such attempt:
Undefined function or variable 'x'.
Thanks for the help!