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

📄 imag2reallmi.m

📁 optimization toolbox
💻 M
字号:
function Freal = imag2reallmi(F)

% Author Johan L鰂berg 
% $Id: imag2reallmi.m,v 1.3 2005/02/04 10:10:26 johanl Exp $

Counter = size(F.clauses,2);
Freal = F;
j=1;
for i = 1:Counter
    if isreal(F.clauses{i}.data)
        Freal.clauses{j}=F.clauses{i};
        j = j+1;
    else
        switch F.clauses{i}.type
            case 1
                reF=real(F.clauses{j}.data);
                imF=imag(F.clauses{j}.data);
                Freal.clauses{j}.data=[reF imF;-imF reF];
                j = j+1;
            case {2,3}
                reF=real(F.clauses{j}.data);
                imF=imag(F.clauses{j}.data);
                Freal.clauses{j}.data=[reF;imF];
                j = j+1;
            case 4
                reF=real(F.clauses{j}.data);
                imF=imag(F.clauses{j}.data);
                Freal.clauses{j}.data=[reF(1);reF(2:end);imF(2:end)];
                j = j+1;       
            otherwise
                error('Internal bug. Please report.');
        end
    end
end

⌨️ 快捷键说明

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