yunying
2010-03-25, 09:19
函数如下:U是URL的集合,函数的功能是根据链接关系建立一个关系矩阵。
function G = matrix(U,n)
G = logical(sparse(n,n));
m = 1;
i = 1;
for j = 1:n
page = urlread(U{i});
for f = findstr('http:',page) % A link starts with 'http:' and ends with the next quote.
e = min([findstr('"',page(f:end)) findstr('''',page(f:end))]);
if isempty(e), continue, end
url = deblank(page(f:f+e-2
if ( U{i} == url )
G(i,j) = 1;
line(j,i,'marker','.','markersize',6)
continue
end
j = j+1;
end
end
运行时报错 Error using ==> eq
Matrix dimensions must agree.
Error in ==> matrix at 13
if ( U{i} == url )
我刚开始学Matlab,希望大家帮我看看,谢谢!
function G = matrix(U,n)
G = logical(sparse(n,n));
m = 1;
i = 1;
for j = 1:n
page = urlread(U{i});
for f = findstr('http:',page) % A link starts with 'http:' and ends with the next quote.
e = min([findstr('"',page(f:end)) findstr('''',page(f:end))]);
if isempty(e), continue, end
url = deblank(page(f:f+e-2
if ( U{i} == url )
G(i,j) = 1;
line(j,i,'marker','.','markersize',6)
continue
end
j = j+1;
end
end
运行时报错 Error using ==> eq
Matrix dimensions must agree.
Error in ==> matrix at 13
if ( U{i} == url )
我刚开始学Matlab,希望大家帮我看看,谢谢!