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/12/19 03:43:34
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函数文件,保存为文件名与函数名一致,然后再命令窗口输入定义的函数,敲回车就可以运行出结果.