Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
初级会员
注册日期: 2010-03-09
帖子: 4
声望力: 0 ![]() |
![]()
函数如下: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,希望大家帮我看看,谢谢! |
![]() |
![]() |