setrval.m.txt

来自「这是马尔可夫-蒙特卡罗算法的MATLAB源程序.」· 文本 代码 · 共 9 行

TXT
9
字号
function DR = SetRVal(DR,inds1,inds2,r)
% DR = SetRVal(DR,inds1,inds2,r)
% set the value of the resistor from point inds1 (array-style indices) 
% to point inds2 to value r

% Colin Fox, 21 Jan 2003

nnps = round(sqrt(size(DR,1))); % number of nodes per side
DR(sub2ind([nnps nnps],inds1(2),inds1(1)),sub2ind([nnps nnps],inds2(2),inds2(1)))=r;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?