我有以下情节:
patch('Vertices',rocket_point_cloud,'Faces',rocket_faces,...
'FaceColor','red','EdgeColor','none',...
'BackFaceLighting','reverselit',...
'SpecularStrength',1,'DiffuseStrength',1)
我想重用绘图选项,即重用:
'FaceColor','red','EdgeColor','none',...
'BackFaceLighting','reverselit',...
'SpecularStrength',1,'DiffuseStrength',1
以某种方式可以将上述内容存储在变量中,例如my_options
以及稍后的事情:
patch('Vertices',other_cloud,'Faces',other_faces,my_options)
感谢您的帮助!
答案 0 :(得分:5)
不确定。只需在cell array,
中定义您的选项即可my_options = {'FaceColor','red','EdgeColor','none',...
'BackFaceLighting','reverselit',...
'SpecularStrength',1,'DiffuseStrength',1};
然后通过大括号索引将该单元格数组扩展为comma-separated list:
patch('Vertices', rocket_point_cloud, 'Faces', rocket_faces, my_options{:})