ex2416.m
来自「MATLAB7.0课本所有程序清单,共37章,特别适合初学者,可以帮助节省大量时」· M 代码 · 共 24 行
M
24 行
%例24-16 设置多个片块模型的颜色
%Ex24-16 set colors in multi-patches model
clear
close all
Vm=[0 0 0;1 0 0;1 0 1;0 0 1;0 1 1;1 1 1;1 1 0];
Fm=[1 2 3 4;3 4 5 6;6 3 2 7];
subplot(3,2,1)
patch('Vertices',Vm,'Faces',Fm,'FaceVertexCData',rand(1,1),'FaceColor','flat')
view([30,30]);title('set uniform index-color')
subplot(3,2,2)
patch('Vertices',Vm,'Faces',Fm,'FaceVertexCData',rand(1,3),'FaceColor','flat')
view([30,30]);title('set uniform RGB-color')
subplot(3,2,3)
patch('Vertices',Vm,'Faces',Fm,'FaceVertexCData',rand(size(Vm,1),1),'FaceColor','interp')
view([30,30]);title('assign multi-index-color to Vertices')
subplot(3,2,4)
patch('Vertices',Vm,'Faces',Fm,'FaceVertexCData',rand(size(Vm,1),3),'FaceColor','interp')
view([30,30]);title('assign multi-RGB-color to Vertices')
subplot(3,2,5)
patch('Vertices',Vm,'Faces',Fm,'FaceVertexCData',rand(size(Fm,1),1),'FaceColor','flat')
view([30,30]);title('assign multi-index-color to Faces')
subplot(3,2,6)
patch('Vertices',Vm,'Faces',Fm,'FaceVertexCData',rand(size(Fm,1),3),'FaceColor','flat')
view([30,30]);title('assign multi-RGB-color to Faces')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?