尝试将脚本作为函数执行 [英] Attempt to execute script as a function
本文介绍了尝试将脚本作为函数执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在MATLAB中进行绘制:
I want to plot this in MATLAB:
x=[-2:0.01:4];
y=3.5.^(-0.5*x).*cos(6*x);
plot(x,y)
但是它给出了这样的错误:
but it gives an error like this:
尝试将SCRIPT图作为函数执行:
C:\ Users \ User \ Downloads \ Private \ New文件夹(2)\ Desktop \ plot.m
Attempt to execute SCRIPT plot as a function:
C:\Users\User\Downloads\Private\New folder (2)\Desktop\plot.m
plot67中的错误(第3行)
情节(x,y)
Error in plot67 (line 3)
plot(x,y)
我该如何解决?
推荐答案
将脚本"plot.m"重命名为其他名称.有名称冲突.它认为您是在调用自己的脚本,而不是plot函数.
Rename your script "plot.m" to something else. There's a name conflict. It thinks you're calling your own script and not the plot-function.
这篇关于尝试将脚本作为函数执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文