求解释matlab函数意义函数如下所示:function r=setpath(r,dot_index,dot_x,dot_y,type)r.path_dot(1,dot_index) = dot_x;r.path_dot(2,dot_index) = dot_y;r.path_dot(3,dot_index) = type;end

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 17:43:06

求解释matlab函数意义函数如下所示:function r=setpath(r,dot_index,dot_x,dot_y,type)r.path_dot(1,dot_index) = dot_x;r.path_dot(2,dot_index) = dot_y;r.path_dot(3,dot_index) = type;end
求解释matlab函数意义
函数如下所示:
function r=setpath(r,dot_index,dot_x,dot_y,type)
r.path_dot(1,dot_index) = dot_x;
r.path_dot(2,dot_index) = dot_y;
r.path_dot(3,dot_index) = type;
end

求解释matlab函数意义函数如下所示:function r=setpath(r,dot_index,dot_x,dot_y,type)r.path_dot(1,dot_index) = dot_x;r.path_dot(2,dot_index) = dot_y;r.path_dot(3,dot_index) = type;end
首先r是个结构体,其中有一个成员变量path_dot.
path_dot是一个数组
这个函数的作用是,将结构体r的成员变量path_dot(数组)相应元素进行设置.
具体设置哪个元素和设置什么由dot_index,dot_x,dot_y,type决定.
设置如下:
path_dot(1,dot_index) = dot_x;
path_dot(2,dot_index) = dot_y;
path_dot(3,dot_index) = type;