📄 set_multi_currents.sci
字号:
function [I,Ib]=set_multi_currents(protocol,elec,vtx,gnd_ind,no_pl)I=[];Ib=[];//function [I,Ib] = set_multi_currents(protocol,elec,vtx,gnd_ind,no_pl);// //This functions applies opposite or adjacent current patterns to each of//the planes of the system simultaneously. // // // //protocol= The selected protocol '{op}' or '{ad}'//elec = The electrodes//vtx = The vertices//gnd_ind = the index of the ground node//no_pl = The number of planes//Ib = The current patterns//I = The RHS vectors, i.e., the current patterns padded with zeroes // for the forward calculations no_el = size(elec,1); elpp = no_el/no_pl;eld2 = elpp/2; if protocol=='{op}' then d = eld2; II = []; for j = 1:no_pl Ib = []; for i = 1:d Ip = zeros(elpp,1); Ip(i) = 1 Ip(i+eld2) = -1 Ib = [Ib,Ip]; end II = [II;Ib]; end I = zeros(size(vtx,1),size(Ib,2)); I = [I;II]; end//protocol if protocol=='{ad}' then d = elpp; II = []; for j = 1:no_pl Ib = []; for i = 1:d-1 Ip = zeros(elpp,1); Ip(i) = 1 Ip(i+1) = -1 Ib = [Ib,Ip]; end lx = zeros(elpp,1); //! mtlb(end) can be replaced by end() or end whether end is an m-file or not lx(mtlb(end)) = 1 lx(1) = -1 Ib = [Ib,lx]; II = [II;Ib]; end I = zeros(size(vtx,1),size(Ib,2)); I = [I;II]; end//protocol //! mtlb(end) can be replaced by end() or end whether end is an m-file or notIb = I(size(vtx,1)+1:mtlb(end),:); //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%// This is part of the EIDORS suite.// Copyright (c) N. Polydorides 2001// Copying permitted under terms of GNU GPL// See enclosed file gpl.html for details.// EIDORS 3D version 1.0// MATLAB version 5.3 R11//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -