plotcolorloc.m

来自「一个matlab的将军模型」· M 代码 · 共 35 行

M
35
字号
for i=1:length(GLOBAL_PIHA.Hyperplanes) 
   
   pi1 = [6.04;12.03];
   pi2 = [10.34;8.62];
   pi3 = [ 4.82;1.67];
   pi4 = [ 0.53;5.07];

   cxmax = max([pi1(1),pi2(1),pi3(1),pi4(1)]);
   cxmin = min([pi1(1),pi2(1),pi3(1),pi4(1)]);
   cymax = max([pi1(2),pi2(2),pi3(2),pi4(2)]);
   cymin = min([pi1(2),pi2(2),pi3(2),pi4(2)]);

   A = [1 0 0;-1 0 0;0 1 0; 0 -1 0];
   b = [cxmax;-cxmin;cymax;-cymin];


   switch  GLOBAL_PIHA.Locations{i}.q(2)
      
   case {8,6,4,2}
      color = [1 0 0];
      
   case {1,3,5,7}
      color = [0 0 1];
      
   case 9
      color = [0 1 0];

	end
	test = and(cutsurf,location_invariant(i));
   if ~isempty(test)
      plot(test,color);
      fprintf('ploting Location %4.0f\n',i)
   end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?