你運行一下相信你就知道他是什么意思了
N=13;
height=2;
is=[1:N]'
is([height:height:N])=[]%刪除is矩陣中部分元素
js=is+1
I=[]
I=[I;is;js]
MATLAB高手,請問誰能幫忙解釋以下程序的含義,
MATLAB高手,請問誰能幫忙解釋以下程序的含義,
% EDGE4CONNECTED Creates edges where each node
% is connected to its four adjacent neighbors on a
% height x width grid.
% E - a vector in which each row i represents an edge E(i,1) --> E(i,2).
% The edges are listed is in the following neighbor order:
% down,up,right,left,where nodes indices are taken column-major.
function E = edges4connected(height,width)
N = height*width;
I = []; J = [];
% connect vertically (down,then up)
is = [1:N]'; is([height:height:N])=[];
js = is+1;
I = [I;is;js];
J = [J;js;is];
% connect horizontally (right,then left)
is = [1:N-height]';
js = is+height;
I = [I;is;js];
J = [J;js;is];
E = [I,J];
end
PS:is = [1:N]'; is([height:height:N])=[];
I = [I;is;js];都是什么意思啊?
% EDGE4CONNECTED Creates edges where each node
% is connected to its four adjacent neighbors on a
% height x width grid.
% E - a vector in which each row i represents an edge E(i,1) --> E(i,2).
% The edges are listed is in the following neighbor order:
% down,up,right,left,where nodes indices are taken column-major.
function E = edges4connected(height,width)
N = height*width;
I = []; J = [];
% connect vertically (down,then up)
is = [1:N]'; is([height:height:N])=[];
js = is+1;
I = [I;is;js];
J = [J;js;is];
% connect horizontally (right,then left)
is = [1:N-height]';
js = is+height;
I = [I;is;js];
J = [J;js;is];
E = [I,J];
end
PS:is = [1:N]'; is([height:height:N])=[];
I = [I;is;js];都是什么意思啊?
其他人氣:756 ℃時間:2020-10-02 03:55:37
優(yōu)質(zhì)解答
我來回答
類似推薦
- 七年級下冊語文傷仲永全文翻譯
- 今有物不知其數(shù),三三數(shù)之余二,五五數(shù)之余三,七七數(shù)之余二.問物幾何?
- 解釋同一字在不同句子里的含義
- Her mother worked in a town last year 變?yōu)榉穸ň?、疑問句然后作肯定、否?/a>
- I will wash my clothes If I___(have) time tomorrow morning
- Gina常坐9路公交車回家翻譯
- 利用馬克思主義基本原理概論回答,為什么說“資本來到世間,從頭到腳,每個毛孔都滴著血和骯臟的東西”?
- 梯形的高不變,上底和下底都擴大4倍,則面積( )
- 修改病句: 跟敵人斗爭時,態(tài)度多么堅決 速度 在線等
- 小丁丁期未考試五門功課的平均分是91分,如果去掉最高的數(shù)學(xué)100分和最低的英語分
- read和words這兩個英語單詞什么意思?
- 2010合肥一中最后一卷理科數(shù)學(xué)答案
猜你喜歡
- 1山中訪友最主要講什么?
- 2已知AB=AC,AD垂直BC于DM、N為AD上的點.CM、CN是角ACB的三等分線,BN交AC于E.說明
- 3變化在漢語中是動詞還是名詞
- 4Someone says,“Time is money.”But I think time is _____important than money.
- 51.一列火車長168m 以72km/h的速度行駛,一輛汽車以8m/s的速度行駛.當(dāng)兩輛車同時行駛時,
- 6寫擬人手法的好處是什么?
- 7寫一個不帶關(guān)聯(lián)詞語表因果關(guān)系的句子
- 8有一個高壓鍋,鍋內(nèi)氣壓每增加100℃,水的沸點相應(yīng)增加1℃.國內(nèi)水的初始溫度是20℃.
- 9為什么有的電解方程式中,氫離子參與反應(yīng),但是在總反應(yīng)中要寫成水的形式?
- 10計算(-2)^2007+(-2)^2008=(-2)^2007+2^2008=2^2007x(2-1) 請解答 如何做啊
- 11掌上珊瑚憐不得 卻叫移作上陽花 .
- 12關(guān)于強調(diào)句的一個問題~