当前位置: > 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];都是什么意思啊?

提问时间:2021-03-29

答案
你运行一下相信你就知道他是什么意思了
N=13;
height=2;
is=[1:N]'
is([height:height:N])=[]%删除is矩阵中部分元素
js=is+1
I=[]
I=[I;is;js]
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.