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

📄 process_label_string.m

📁 CheckMate is a MATLAB-based tool for modeling, simulating and investigating properties of hybrid dyn
💻 M
字号:
function [event_expr,cond_expr,clock,reset_flag] = process_label_string(labelString,sfdata,sf_machine,clockHandle)% Assume that the condition expression lies between brackets% (this should have been checked previously).%Also assume that if there is a clock associated with this transition, it%appears as the first element in the expression and that it is 'and'ed%with the rest of the expression.%Example: [(clock1==1)&((A==1)&B==1))]clock=[];no_condition=0;start = findstr(labelString,'[');%Find where the reset event starts (if there is one)reset_start=findstr(labelString,'/');reset_flag=0;if ~isempty(start)   event_expr = labelString(1:start-1);elseif ~isempty(reset_start)   event_expr = labelString(1:reset_start-1);else   event_expr= labelString;end% Test to see if the SF machine has event inputs but this transition% does not.  Added by JPK (11/2002).if isempty(event_expr)&~isempty(sfdata{sf_machine}.InputEvent)   error(['Stateflow machine has event inputs, but at least one transition '    'does not have an event associated with it.']);% movedendif ~isempty(reset_start)if ~isempty(findstr('reset',labelString(reset_start+1:length(labelString))))         reset_flag=1;else         error('Invalid reset event.')endend  stop = findstr(labelString,']');  is_clock=0;  %Test for a clocked event in the event section of the labelstring  for i=1:length(sfdata{sf_machine}.Clock)     name=sfdata{sf_machine}.Clock{i}.Name;     name=deblank(name);     is_clock=strcmp(name,event_expr);     if is_clock        event_expr=[];        zoh_block=sfdata{sf_machine}.Clock{i}.ClockHandle;        [dum1,dum2,clock]=intersect(zoh_block,clockHandle);        break;     end  end cond_expr = labelString(start+1:stop-1);return% ----------------------------------------------------------------------------

⌨️ 快捷键说明

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