이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
matlab.System 클래스
System Object의 기본 클래스
설명
matlab.System
은 System Object에 대한 기본 클래스입니다. 클래스 정의 파일에서 사용자는 이 기본 클래스(또는 이 기본 클래스에서 파생한 다른 클래스)에서 객체의 서브클래스를 생성해야 합니다. 서브클래스를 생성하면 이 기본 클래스에서 제공하는 구현 메서드와 서비스 메서드를 사용하여 객체를 빌드할 수 있습니다. 다음 구문을 클래스 정의 파일의 첫 번째 라인으로 입력하여 matlab.System
기본 클래스에서 직접 상속합니다. 여기서 ObjectName
은 객체의 이름입니다.
classdef ObjectName < matlab.System
참고
코드에서 사용하는 matlab.System
메서드마다 Access = protected
를 설정해야 합니다.
matlab.System
클래스는 handle
클래스입니다.
메서드
작성 메서드(보호)
getNumInputsImpl | Number of inputs to the System object |
isInputDataTypeMutableImpl | Set whether System object input data type can change |
isInputSizeMutableImpl | Set whether System object input size can change |
isInputComplexityMutableImpl | Set whether System object input complexity can change |
isInputDirectFeedthroughImpl | Direct feedthrough status of input |
getInputDimensionConstraintImpl | Define input dimension constraints for dataflow subsystems |
getNumOutputsImpl | Number of outputs from System object |
getOutputDataTypeImpl | Data types of output ports |
getOutputSizeImpl | Sizes of output ports |
isOutputComplexImpl | Complexity of output ports |
isOutputFixedSizeImpl | Fixed- or variable-size output ports |
getOutputDimensionConstraintImpl | Define output dimension constraints for dataflow subsystems |
getDiscreteStateSpecificationImpl | Discrete state size, data type, and complexity |
isDiscreteStateSpecificationMutableImpl | Control whether discrete states can change data type |
getDiscreteStateImpl | Discrete state property values |
getSampleTimeImpl | Specify sample time type, offset time, and sample time |
allowModelReferenceDiscreteSampleTimeInheritanceImpl | Model reference sample time inheritance status for discrete sample times |
getGlobalNamesImpl | Global variable names for MATLAB System block |
getInterfaceImpl (Simulink) | Set System object as message or data |
isTunablePropertyDataTypeMutableImpl | Set whether tunable properties can change data type |
isDoneImpl | End-of-data flag |
getSimulateUsingImpl | Specify value for Simulate using parameter |
getSimulinkFunctionNamesImpl | Register Simulink function names used in your System object |
showFiSettingsImpl | Fixed point data type tab visibility for System objects |
supportsMultipleInstanceImpl | Support System object in Simulink For Each subsystem |
getImpulseResponseLengthImpl | Define length of input effects for dataflow subsystems |
getPropertyGroupsImpl | Property groups for System object display |
showSimulateUsingImpl | Visibility of Simulate using parameter |
getIconImpl | Name to display as block icon |
getHeaderImpl | Header for System object display |
getInputNamesImpl | Names of MATLAB System block input ports |
getOutputNamesImpl | Names of MATLAB System block output ports |
isInactivePropertyImpl | Status of inactive property |
setupImpl | Initialize System object |
stepImpl | System output and state update equations |
resetImpl | Reset System object states |
releaseImpl | Release resources |
processTunedPropertiesImpl | Action when tunable properties change |
validatePropertiesImpl | Validate property values of System object |
processInputSpecificationChangeImpl | Perform actions when input size, complexity, or data type change |
validateInputsImpl | Validate inputs to System object |
updateImpl | Update object states based on inputs |
loadObjectImpl | Load System object from MAT file |
saveObjectImpl | Save System object in MAT file |
infoImpl | Information about System object |
쿼리 함수(보호)
setProperties | Set property values using name-value pairs when creating System object |
propagatedInputComplexity | Complexity of input during Simulink propagation |
propagatedInputDataType | Data type of input during Simulink propagation |
propagatedInputFixedSize | Fixed-size status of input during Simulink propagation |
propagatedInputSize | Size of input during Simulink propagation |
createSampleTime | Create sample time specification object |
getSampleTime | Query sample time |
getCurrentTime | Current simulation time in MATLAB System block |
setNumTicksUntilNextHit (Simulink) | Set the number of ticks in Simulink sample time |
displayScalarObject | 스칼라 객체의 형식 표시 |
getHeader | 표시할 헤더 텍스트 작성 및 반환 |
getFooter | 푸터를 표시하는 텍스트 작성 및 반환 |
구현 메서드(퍼블릭)
nargin | Number of input arguments for System object |
nargout | Number of output arguments for System object |
getNumInputs | Number of inputs required to call the System object |
getNumOutputs | Number of outputs from calling the System object |
setup | One-time set up tasks for System objects |
reset | System object의 내부 상태 재설정 |
step | System object 알고리즘 실행 |
release | 리소스 해제 및 System object 속성값과 입력 특성 변경 허용하기 |
clone | 중복 System object 생성 |
isDone | End-of-data status |
isLocked | Determine if System object is in use |
예제
기본 System Object 만들기
이 예제에서는 AddOne
이라고 하는 기본 System Object를 작성하는 방법을 보여줍니다.
MATLAB에서 새로 만들기 > System Object > 기본을 선택합니다. 새 편집기 창이 열리고 새 System Object의 디폴트 구문과 주석이 표시됩니다.
클래스 이름을 AddOne
으로 바꿉니다. 클래스가 다음과 같이 되도록 디폴트 템플릿을 수정합니다.
classdef AddOne < matlab.System % ADDONE Compute an output value that increments the input by one methods (Access = protected) % Implement algorithm. Calculate y as a function of input x. function y = stepImpl(~,x) y = x + 1; end end end
AddOne
인스턴스를 만들고 입력값과 함께 객체를 실행하여 이 객체를 사용합니다.
addingObject = AddOne; x = 5; addingObject(x)
ans = 6
세부 정보
특성
System object™ 클래스와 속성에 특성을 적용할 수 있습니다. 특성에 대해 자세히 알아보려면 클래스 특성 또는 속성 특성을 참조하십시오.
이 표는 MATLAB® System object 클래스에 적용할 수 있는 특성을 보여줍니다.
특성 이름 | 설명 |
StrictDefaults | 사양을 수정할 수 있도록 변경하는 것을 제한하는 메서드의 디폴트 값을 제어합니다.
기본적으로 이러한 메서드는 Simulink®에서 사용되는 System Object의 경우 Simulink에서 이미 조정 가능형 속성, 입력값 및 상태의 실수/복소수 여부와 데이터형을 제한하므로 이 특성은 입력 크기 변경만 제한합니다. |
클래스 이름 앞에 괄호를 사용하여 클래스 특성 값을 지정하십시오. 예를 들면 다음과 같습니다.
classdef (StrictDefaults) MySystemObject < matlab.System
사용자 지정 System object의 속성에 다음 특성을 적용할 수 있습니다.
Nontunable | Nontunable 을 사용하여 객체가 사용 중일 때 속성값이 변경되는 것을 방지할 수 있습니다. 기본적으로 모든 속성은 조정 가능합니다. Nontunable 특성은 변경 시 부작용이 있는 속성을 잠그는 데 유용합니다. 이 특성은 처리하는 동안 상수라고 가정하는 속성값을 잠그는 데도 유용합니다. 항상 입력 포트 개수 또는 출력 포트 개수에 영향을 미치는 속성을 Nontunable 로 지정해야 합니다. |
DiscreteState | DiscreteState 를 사용하여 속성을 표시하면 사용자가 getDiscreteState 메서드를 사용할 때 속성의 상태 값이 표시됩니다. |
버전 내역
R2011b에 개발됨
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)