Multiple errors with derivative calculator code
显示 更早的评论
disp('This calculates a polynomial derivative at a specific point')
x = sym ('x');
g = input('What is your polynomial function?','s');
f() = str2func(['@(x)', 'g']);
a = input('What value would you like to derive it at?');
n = limit ((f(x) - f(a))/(x-a),a);
fprintf('The derivative of %s \n', f(x))
fprintf('at point %f is %f',n)
I get an error message here:
Error: File: DerivativeCalculator.m Line: 5 Column: 2
An indexing expression on the left side of an assignment must have at least one subscript.
What are the problems with my code?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!