Matlab程序报错,问下高手那里出错了tic; for k=1:ND = min(D,repmat(D(:,k),[1 N])+repmat(D(k,:),[N 1])); if ((verbose == 1) & (rem(k,20) == 0)) disp([' Iteration:' num2str(k) ' Estimated time to completion:'num2str((N-k)*toc/k/60) ' minutes'
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/25 18:44:45
![Matlab程序报错,问下高手那里出错了tic; for k=1:ND = min(D,repmat(D(:,k),[1 N])+repmat(D(k,:),[N 1])); if ((verbose == 1) & (rem(k,20) == 0)) disp([' Iteration:' num2str(k) ' Estimated time to completion:'num2str((N-k)*toc/k/60) ' minutes'](/uploads/image/z/472506-42-6.jpg?t=Matlab%E7%A8%8B%E5%BA%8F%E6%8A%A5%E9%94%99%2C%E9%97%AE%E4%B8%8B%E9%AB%98%E6%89%8B%E9%82%A3%E9%87%8C%E5%87%BA%E9%94%99%E4%BA%86tic%3B+for+k%3D1%3AND+%3D+min%28D%2Crepmat%28D%28%3A%2Ck%29%2C%5B1+N%5D%29%2Brepmat%28D%28k%2C%3A%29%2C%5BN+1%5D%29%29%3B+if+%28%28verbose+%3D%3D+1%29+%26+%28rem%28k%2C20%29+%3D%3D+0%29%29+disp%28%5B%27+Iteration%3A%27+num2str%28k%29+%27+Estimated+time+to+completion%3A%27num2str%28%28N-k%29%2Atoc%2Fk%2F60%29+%27+minutes%27)
Matlab程序报错,问下高手那里出错了tic; for k=1:ND = min(D,repmat(D(:,k),[1 N])+repmat(D(k,:),[N 1])); if ((verbose == 1) & (rem(k,20) == 0)) disp([' Iteration:' num2str(k) ' Estimated time to completion:'num2str((N-k)*toc/k/60) ' minutes'
Matlab程序报错,问下高手那里出错了
tic;
for k=1:N
D = min(D,repmat(D(:,k),[1 N])+repmat(D(k,:),[N 1]));
if ((verbose == 1) & (rem(k,20) == 0))
disp([' Iteration:' num2str(k) ' Estimated time to completion:'num2str((N-k)*toc/k/60) ' minutes']);
end
end
显示错误是?Error:File:Isomap.m Line:141 Column:80
Unexpected MATLAB expression.
disp([' Iteration:' num2str(k) ' Estimated time to completion:'num2str((N-k)*toc/k/60) ' minutes']);
是这一行报错
Matlab程序报错,问下高手那里出错了tic; for k=1:ND = min(D,repmat(D(:,k),[1 N])+repmat(D(k,:),[N 1])); if ((verbose == 1) & (rem(k,20) == 0)) disp([' Iteration:' num2str(k) ' Estimated time to completion:'num2str((N-k)*toc/k/60) ' minutes'
disp([' Iteration: ' num2str(k) ' Estimated time to completion: 'num2str((N-k)*toc/k/60) ' minutes']); % 这一行应该为:
% disp([' Iteration: ',num2str(k),' Estimated time to completion: ',num2str((N-k)*toc/k/60),' minutes']); % 加上逗号,这样格式就正确了,(假设有两个矩阵A、B,那么[A,B]的意思是A和B拼接起来)