?? count_num.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 + -