Error: Function definitions are not permitted at the prompt or in scripts.x=[11.9 11.5 14.5 15.2 15.9 16.3 14.6 12.9 15.8 14.1];y=[196.84 196.84 197.14 197.03 197.05 197.13 197.04 196.96 196.95 196.98];function sdt( x, y); %绘制散点图x= x( : ) ;
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/30 08:35:05
![Error: Function definitions are not permitted at the prompt or in scripts.x=[11.9 11.5 14.5 15.2 15.9 16.3 14.6 12.9 15.8 14.1];y=[196.84 196.84 197.14 197.03 197.05 197.13 197.04 196.96 196.95 196.98];function sdt( x, y); %绘制散点图x= x( : ) ;](/uploads/image/z/8729292-12-2.jpg?t=Error%3A+Function+definitions+are+not+permitted+at+the+prompt+or+in+scripts.x%3D%5B11.9+11.5+14.5+15.2+15.9+16.3+14.6+12.9+15.8+14.1%5D%3By%3D%5B196.84+196.84+197.14+197.03+197.05+197.13+197.04+196.96+196.95+196.98%5D%3Bfunction+sdt%28+x%2C+y%29%3B+%25%E7%BB%98%E5%88%B6%E6%95%A3%E7%82%B9%E5%9B%BEx%3D+x%28+%3A+%29+%3B)
Error: Function definitions are not permitted at the prompt or in scripts.x=[11.9 11.5 14.5 15.2 15.9 16.3 14.6 12.9 15.8 14.1];y=[196.84 196.84 197.14 197.03 197.05 197.13 197.04 196.96 196.95 196.98];function sdt( x, y); %绘制散点图x= x( : ) ;
Error: Function definitions are not permitted at the prompt or in scripts.
x=[11.9 11.5 14.5 15.2 15.9 16.3 14.6 12.9 15.8 14.1];
y=[196.84 196.84 197.14 197.03 197.05 197.13 197.04 196.96 196.95 196.98];
function sdt( x, y); %绘制散点图
x= x( : ) ; y= y( : ); %试验所得向量
figure
plot( x, y , , * b, ); %以X 为横轴, Y 为纵轴, 以蓝色绘制散点图
title(, 散点图, )
Error: Function definitions are not permitted at the prompt or in scripts.x=[11.9 11.5 14.5 15.2 15.9 16.3 14.6 12.9 15.8 14.1];y=[196.84 196.84 197.14 197.03 197.05 197.13 197.04 196.96 196.95 196.98];function sdt( x, y); %绘制散点图x= x( : ) ;
也许你要注意脚本文件与m文件之间的差别,不能直接在命令窗口和直接新建的m文件(脚本文件script)中运行.你要将这个函数命令保存为一M函数文件,保存为文件名与函数名一致,然后再命令窗口输入定义的函数,敲回车就可以运行出结果.