注册 登录
编程论坛 Matlab

函数文件

huxiaolong 发布于 2007-07-09 12:29, 897 次点击
怎样才能把M文件放到搜索路径上
function [mean,stdev] = stat(x)
n = length(x);
mean = sum(x)/n;
stdev = sqrt(sum((x-mean).^2/n));
??? function [mean,stdev] = stat(x)
|
Error: Function definitions are not permitted at the prompt or in scripts.
这个编程错在那里,我想了半天也不能想出,请那位大哥教一下
2 回复
#2
abingchem2007-07-09 13:44
File->Set Path
#3
geoer2007-07-09 22:05

先看基础书,函数不能在命令窗口定义.

1