求解释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/06/20 11:56:21
![求解释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](/uploads/image/z/7148262-30-2.jpg?t=%E6%B1%82%E8%A7%A3%E9%87%8Amatlab%E5%87%BD%E6%95%B0%E6%84%8F%E4%B9%89%E5%87%BD%E6%95%B0%E5%A6%82%E4%B8%8B%E6%89%80%E7%A4%BA%EF%BC%9Afunction+r%3Dsetpath%28r%2Cdot_index%2Cdot_x%2Cdot_y%2Ctype%29r.path_dot%281%2Cdot_index%29+%3D+dot_x%3Br.path_dot%282%2Cdot_index%29+%3D+dot_y%3Br.path_dot%283%2Cdot_index%29+%3D+type%3Bend)
求解释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;