⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rhomat.m

📁 The package includes 3 Matlab-interfaces to the c-code: 1. inference.m An interface to the full
💻 M
字号:
function rho = rhoMat(rhoVal,adj)rhoSize = size(rhoVal);N = size(adj,1);neighbNum = sum(adj);if (iscell(rhoVal))    error('argument given for trw (in loopy) must either be a scalar or a matrix in size <num_nodes> x <num_nodes>');endif prod(rhoSize)==1    rho = cell(1,N);    for i=1:N        rho{i} = rhoVal*ones(1,neighbNum(i));    endelse    if (length(rhoSize)~=2 || rhoSize(1)~=N || rhoSize(2)~=N)        error('argument given for trw (in loopy) must either be a scalar or a matrix in size <num_nodes> x <num_nodes>');    else        rho = cell(1,N);        for i=1:N            if neighbNum(i)>0                rho{i} = rhoVal(i,find(adj(i,:)));            end        end    endend

⌨️ 快捷键说明

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