matlab.System 클래스
System Object의 기본 클래스
설명
matlab.System
은 System Object에 대한 기본 클래스입니다. 클래스 정의 파일에서 사용자는 이 기본 클래스(또는 이 기본 클래스에서 파생한 다른 클래스)에서 객체의 서브클래스를 생성해야 합니다. 서브클래스를 생성하면 이 기본 클래스에서 제공하는 구현 메서드와 서비스 메서드를 사용하여 객체를 빌드할 수 있습니다. 다음 구문을 클래스 정의 파일의 첫 번째 라인으로 입력하여 matlab.System
기본 클래스에서 직접 상속합니다. 여기서 ObjectName
은 객체의 이름입니다.
classdef ObjectName < matlab.System
참고
코드에서 사용하는 matlab.System
메서드마다 Access = protected
를 설정해야 합니다.
matlab.System
클래스는 handle
클래스입니다.
메서드
보호 메서드
setupImpl | Initialize System object |
stepImpl | System output and state update equations |
resetImpl | Reset System object states |
releaseImpl | Release resources |
getDiscreteStateImpl | Discrete state property values |
infoImpl | Information about System object |
isDoneImpl | End-of-data flag |
isInactivePropertyImpl | Status of inactive property |
isTunablePropertyDataTypeMutableImpl | Set whether tunable properties can change data type |
isDiscreteStateSpecificationMutableImpl | Control whether discrete states can change data type |
processTunedPropertiesImpl | Action when tunable properties change |
setProperties | Set property values using name-value pairs when creating System object |
validatePropertiesImpl | Validate property values of System object |
getNumInputsImpl | Number of inputs to the System object |
getNumOutputsImpl | Number of outputs from System object |
getNumInputs | Number of inputs required to call the System object |
getNumOutputs | Number of outputs from calling the System object |
getInterfaceImpl (Simulink) | Set System object as message or data |
isInputComplexityMutableImpl | Set whether System object input complexity can change |
isInputDataTypeMutableImpl | Set whether System object input data type can change |
isInputSizeMutableImpl | Set whether System object input size can change |
nargin | Number of input arguments for System object |
nargout | Number of output arguments for System object |
processInputSpecificationChangeImpl | Perform actions when input size, complexity, or data type change |
validateInputsImpl | Validate inputs to System object |
loadObjectImpl | Load System object from MAT file |
saveObjectImpl | Save System object in MAT file |
allowModelReferenceDiscreteSampleTimeInheritanceImpl | Model reference sample time inheritance status for discrete sample times |
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 |
getSimulateUsingImpl | Specify value for Simulate using parameter |
supportsMultipleInstanceImpl | Support System object in Simulink For Each subsystem |
isInputDirectFeedthroughImpl | Direct feedthrough status of input |
outputImpl | Output calculation from input or internal state of System object |
updateImpl | Update object states based on inputs |
getDiscreteStateSpecificationImpl | Discrete state size, data type, and complexity |
getOutputDataTypeImpl | Data types of output ports |
getOutputSizeImpl | Sizes of output ports |
isOutputComplexImpl | Complexity of output ports |
isOutputFixedSizeImpl | Fixed- or variable-size output ports |
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 |
getIconImpl | Name to display as block icon |
getHeaderImpl | Header for System object display |
matlab.system.display.Action | Custom button |
matlab.system.display.Header | Header for System objects properties |
matlab.system.display.Icon | 사용자 지정 아이콘 이미지 |
matlab.system.display.Section | Property group section for System objects |
matlab.system.display.SectionGroup | Section group for System objects |
getInputNamesImpl | Names of MATLAB System block input ports |
getOutputNamesImpl | Names of MATLAB System block output ports |
getGlobalNamesImpl | Global variable names for MATLAB System block |
showSimulateUsingImpl | Visibility of Simulate using parameter |
createSampleTime | Create sample time specification object |
getSampleTime | Query sample time |
getSampleTimeImpl | Specify sample time type, offset time, and sample time |
getCurrentTime | Current simulation time in MATLAB System block |
allowModelReferenceDiscreteSampleTimeInheritanceImpl | Model reference sample time inheritance status for discrete sample times |
getImpulseResponseLengthImpl | Define length of input effects for dataflow subsystems |
getInputDimensionConstraintImpl | Define input dimension constraints for dataflow subsystems |
getOutputDimensionConstraintImpl | Define output dimension constraints for dataflow subsystems |
예제
기본 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™ 클래스와 속성에 특성을 적용할 수 있습니다. 특성에 대해 자세히 알아보려면 클래스 특성 또는 속성 특성(Attribute) 항목을 참조하십시오.
이 표는 MATLAB System object 클래스에 적용할 수 있는 특성을 보여줍니다.
특성 이름 | 설명 |
StrictDefaults | 사양을 수정할 수 있도록 변경하는 것을 제한하는 메서드의 디폴트 값을 제어합니다.
기본적으로 이러한 메서드는 Simulink®에서 사용되는 System Object의 경우 Simulink에서 이미 조정 가능형 속성, 입력값 및 상태의 실수/복소수 여부와 데이터형을 제한하므로 이 특성은 입력 크기 변경만 제한합니다. |
클래스 이름 앞에 괄호를 사용하여 클래스 특성 값을 지정하십시오. 예를 들면 다음과 같습니다.
classdef (StrictDefaults) MySystemObject < matlab.System
사용자 지정 System object의 속성에 다음 특성을 적용할 수 있습니다.
Nontunable | Nontunable 을 사용하여 객체가 사용 중일 때 속성값이 변경되는 것을 방지할 수 있습니다. 기본적으로 모든 속성은 조정 가능합니다. Nontunable 특성은 변경 시 부작용이 있는 속성을 잠그는 데 유용합니다. 이 특성은 처리하는 동안 상수라고 가정하는 속성값을 잠그는 데도 유용합니다. 항상 입력 포트 개수 또는 출력 포트 개수에 영향을 미치는 속성을 Nontunable 로 지정해야 합니다. |
DiscreteState | DiscreteState 를 사용하여 속성을 표시하면 사용자가 getDiscreteState 메서드를 사용할 때 속성의 상태 값이 표시됩니다. |
버전 내역
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)