How can i plot function from str2func ?
显示 更早的评论
Sorry im a beginner, I use "str2func" to plot function, but this dont work. I got "Error using plot Invalid second data argument"
x=0:0.1:3;
fstring='@(x)2.^x';
fplot = str2func(fstring);
plot(app.UIAxes,x,fplot);
but this works :
x=0:0.1:3;
f=2.^x;
plot(app.UIAxes,x,f);
Why wont matlab plot first one ? And how do I solve it? Thanks
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!