Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2009-12-22, 14:24   #1
syy819
初级会员
 
注册日期: 2009-12-01
年龄: 34
帖子: 1
声望力: 0
syy819 正向着好的方向发展
默认 在别人的matlab上运行正常的代码,在我这里就是没办法运行

我用的是matlab(R2009b),运行以下代码
k='Y';
while((k== 'y')|(k== 'Y'))
F=input('Please input the temperature in degree F:')
C=(5/9)*(F-32)
k=input('Do you want to continue? If yes input Y/y, If not input N/n','s')
end
提示出错,信息是
??? Error using ==> tf.tf at 121
Invalid syntax for the "tf" command. Type "help tf" for more information.

运行这段代码
function std = Std(x)
if length(x)<2;
disp('standard deviation is meaningless for a single number')
disp('please return this program for a vector')
return
end
av=sum(x)/length(x);
stdPw2=sum((x-av).*(x-av))/(length(x)-1);
std=sqrt(stdPw2);
end
提示信息如下
??? Input argument "x" is undefined.
Error in ==> Std at 2
if length(x)<2;

这两段代码在别人的matlab上运行都是正常的,纠结……
syy819 当前离线   回复时引用此帖
 


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 11:57


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.