⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ellipplot.m

📁 matlab波形优化算法经常要用到的matlab toolbox工具箱:yalmip
💻 M
字号:
function [xe,ye]=ellipplot(P,gamma,ecolor,xc)
%DUAL2CELL Internal function for plotting ellipsoid

% Author Johan L鰂berg
% $Id: ellipplot.m,v 1.2 2004/07/02 08:17:30 johanl Exp $

if nargin<4
   xc = zeros(length(P),1);
end

if nargin<3
   ecolor = [1 0 0];
end

if nargin<2
   gamma = 1;
end

P=P/gamma;
P=chol(P);

theta = linspace(-pi,pi,100);
z = [cos(theta); sin(theta)];

x = inv(P)*z;
for n=1:length(x)
  x(:,n)=x(:,n)+xc;
end;

fill(x(1,:),x(2,:),ecolor)

⌨️ 快捷键说明

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