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

📄 bx.m

📁 Sector Beam Generation Program for computing Phase distribution function and Radiation pattern
💻 M
字号:

function B = BX(x, c)
% function for comuting b(x) for a given x
% c indicates the choice of the function
% c = 0 means a(x, y) = 1
% c = any other value means a(x, y) = 1 + 0.25 * cos(pi * sqrt(x^2 + y^2))
    sum  = 0;
    term = 0;
    L = sqrt(1 - x .^ 2);
    i = 0;
    h1 = 2 * L /99;
    for y = -L : h1 : L
        if(c == 0)
            term = 1;
        else
            term = 1 + 0.25 * cos(pi * sqrt(x .^ 2 + y ^ 2));
        end;
        if (i == 0 || i == 99)
            sum = sum + term;
        else
            if (mod(i, 2) == 0)
                sum = sum + 2 * term;
            else
                sum = sum + 4 * term;
             end;
        end;
        i = i + 1;
    end;
    B =  sum * h1 / 3;

⌨️ 快捷键说明

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