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

📄 count_num.m

📁 802.11仿真源码 对分析RSSI很有用的
💻 M
字号:
function [First, Last] = Count_num(array, int)
% Given an array and an integer, this function returns the first occurance 
% of that integer and the number of integers that occur within the array

count = 0;
i = 1;
initial = 0;
first = 0;

while(i<=length(array)) 
    if(array(i) == int)
        count = count + 1;
        if(initial == 0)
            first = i;
            initial = 1;
        end
    end
    i = i + 1;
end

First = first;        
Last = count + first - 1;

⌨️ 快捷键说明

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