0
用户给出了一个函数,并且我使用syms(x)
和ezplot(funcion)
作为坐标轴。而在另一种情况下,用户给出的功能和时间间隔为x
。在第二个例子中,我使用plot()
而不是ezplot()
。这里是我的代码=如何在Matlab中填充曲线下的区域
syms x;
funcion=eval(get(handles.txtFuncion, 'String'));
ezplot(funcion);
第二个代码是这样的:
a=eval(get(handles.txtA, 'String'));
b=eval(get(handles.txtB, 'String'));
x=a:b;
funcion=eval(get(handles.txtFuncion, 'String'));
plot(x,funcion);
[''区域'](http://www.mathworks.com/help/matlab/ref/area.html)?顺便说一下,根据函数字符串的格式,我建议使用['str2func'](http://www.mathworks.com/help/matlab/ref/str2func.html)和/或['feval'] (http://www.mathworks.com/help/matlab/ref/feval.html)而不是'eval'。 – excaza
我怎样才能使用面积函数,我不知道如何正确使用它 – Telemaco
'a','b'和'funcion'的一些示例字符串是什么? – excaza