📄 total_auto_states.m
字号:
function total = total_auto_states(from_idx)
% Count the number of states (`initial` and `face` states) in the global
% variable "GLOBAL_AUTOMATON" starting from the given index.
%
% Syntax:
% "total = total_auto_states(from_idx)"
%
% Description:
% Compute the number of `initial` and `face` states in the global variable
% "GLOBAL_AUTOMATON" starting from the index "from_idx".
%
% See Also:
% inc_auto_idx,is_valid_auto_idx,total_new_auto_states
global GLOBAL_AUTOMATON
idx = from_idx;
% if not a valid index, find the next valid index
if ~is_valid_auto_idx(idx)
idx = inc_auto_idx(idx);
end
total = 0;
% increment the state index and the totol the number of states until all
% states has been counted
while ~isempty(idx)
total = total + 1;
idx = inc_auto_idx(idx);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -