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!