You can suppress the ‘ans’ output by calling your function as:
y = fn_eval(c,a,n,x)
That will assign the result to ‘y’. You can suppress the independent ‘y’ output by changing your function to:
function y = fn_eval(c,a,n,x)
y = c*(x - a)^n;
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!