Undefined function or variable 'x'. help
显示 更早的评论
Hi, I'm very new to matlab and i'm trying to write a function that outputs x and y when you input a, b and c (polynomial) and i get Undefined function or variable 'x' when i try to run it.
This is my function currently
function [a,b,c] = Polynomial(x,y)
a=input(a);b=input(b);c=input(c);
g=[a b c];
x=[1:0.01:2];
y=polyval(g,x);
plot(x,y)
end
3 个评论
Walter Roberson
2017-12-15
How are you invoking the function?
Why are you accepting x and y as inputs, but then assigning new values to them?
George Connett
2017-12-15
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!