Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
 
 
主题工具 显示模式
旧 2009-01-06, 22:21   #1
will99031827
初级会员
 
注册日期: 2009-01-06
年龄: 44
帖子: 2
声望力: 0
will99031827 正向着好的方向发展
默认 [求助]一个简单的循环,查不出哪里错了

代码如下:
function A = myHilbert(m,n)
%this is the first function
if nargout>1, error('to many output');end
if nargin ==1, n=m;
elseif nargin==0| nargin >2, error('wrong input');
end

A1 = zeros(m, n);

For i = 1:m
For j = 1:n
A1(i,j)=1/(i+j-1);
end
end

if nargout ==0 disp(A1);
elseif nargout == 1 A = A1;
end

错误提示:
myHilbert.m Line: 14 Column: 1
This statement is not inside any function.
(It follows the END that terminates the definition of the function "myHilbert".)

各位大哥路过此地的,给个答案。拜托了!
第一次发帖,大家新年好!!
will99031827 当前离线   回复时引用此帖
 

主题工具
显示模式

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

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


相似的主题
主题 主题作者 版面 回复 最后发表
[求助]求..正态分布,卡方分布,F分布,T分布的MATLAB代码??? yang25107749 MATLAB论坛 7 2010-04-09 18:44
[求助]分解出来全是黑色一片 yeshenyue MATLAB论坛 1 2009-03-31 10:03
[求助]bp神经网络(急) sosnyf621 MATLAB论坛 0 2008-12-03 16:21
[求助]在SIMULINK里,如何将inegrator上方的箭头移到下面去 yijianmei MATLAB论坛 1 2008-07-24 10:15
[求助]如何对图像(jpg.bmp)进行处理 yong1006boy MATLAB论坛 3 2008-06-21 07:36


所有时间均为北京时间。现在的时间是 13:23


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