matlab错误分析,看不太明白>> A=myhilb(3,4)Error:File:D:\Program Files\MATLAB6p5\Matlab6p5FULL\work\myhilb.m Line:5 Column:4Expected a variable,function,or constant,found "end of line".

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 05:47:41
matlab错误分析,看不太明白>> A=myhilb(3,4)Error:File:D:\Program Files\MATLAB6p5\Matlab6p5FULL\work\myhilb.m Line:5 Column:4Expected a variable,function,or constant,found

matlab错误分析,看不太明白>> A=myhilb(3,4)Error:File:D:\Program Files\MATLAB6p5\Matlab6p5FULL\work\myhilb.m Line:5 Column:4Expected a variable,function,or constant,found "end of line".
matlab错误分析,看不太明白
>> A=myhilb(3,4)
Error:File:D:\Program Files\MATLAB6p5\Matlab6p5FULL\work\myhilb.m Line:5 Column:4
Expected a variable,function,or constant,found "end of line".

matlab错误分析,看不太明白>> A=myhilb(3,4)Error:File:D:\Program Files\MATLAB6p5\Matlab6p5FULL\work\myhilb.m Line:5 Column:4Expected a variable,function,or constant,found "end of line".
myhib 这个函数的第五行第5第4列缺少变量 函数 或者常量
应该是有个变量没有定义
下面贴出一个myhilb产生希尔伯特矩阵的源码
function A=myhilb(n,m)
% MYHILB 是一个示范性的 M-function.
% A=MYHILB(N,M) 会生成一个N×M的Hilbert矩阵A.
% A=MYHILB(N)会生成一个N×N的Hilbert矩阵.
% MYHILB(N,M) 仅仅显示一个Hilbert矩阵,而不会返回任何矩阵.
%这些内容在用help时不会显示
if nargout>1,error('Too many output arguments.'); end
if nargin==1,m=n;
elseif nargin==0 | nargin>2
error('Wrong number of iutput arguments.');
end
A1=zeros(n,m);
for i=1:n
for j=1:m
A1(i,j)=1/(i+j-1);
end
end
if nargout==1,A=A1;
elseif nargout==0,disp(A1);
end