isOutputComplex
Check if outputs of a System object are complex
Description
[
returns whether each output of a System object™ is complex. The number of outputs must match the number of outputs returned by
the cp_1, cp_2, ..., cp_n
] = isOutputComplex(obj
)getNumOutputs
method.
Examples
Check if the outputs of a System object are complex
Call isOutputComplex to check if the outputs of a System object are complex.
Consider a System object object defined as,
classdef UnitDelay < matlab.System % UnitDelayNondirect Delay input by one time step properties(DiscreteState) State Step end methods(Access = protected) function resetImpl(obj) obj.State = 0; % Initialize states obj.Step = 1; end function [y1, y2] = stepImpl(obj,u) y1 = obj.State; % Output current state y2 = obj.Step; obj.State = u; obj.Step = obj.Step + 1; end function [sz1, sz2] = getOutputSizeImpl(obj) sz1 = [1,1]; % Specify size of output port sz2 = [1,1]; end function [flag1, flag2] = isOutputFixedSizeImpl(obj) flag1 = true; % Specify if output is fized size flag2 = true; end function [c1, c2] = getOutputDataTypeImpl(obj) c1 = 'double'; % Specify output datatype c2 = 'double'; end function [c1, c2] = isOutputComplexImpl(obj) c1 = false; % Specify if output is complex c2 = false; end end end
Create an instance of the System object and provide it with an input.
a = UnitDelay(); [out, step] = a(1);
Call isOutputComplex to check if the outputs of the System object are complex.
[cp_1, cp2_2] = isOutputComplex(a);
Input Arguments
obj
— System object
System object
System object handle used to access properties, states, and methods specific to the object.
Output Arguments
cp_1, cp_2, ..., cp_n
— Complexity flag
true
| false
Logical, scalar value indicating whether the specific output port is complex.
true
is returned if output is complex and false
is returned if output is real.
Version History
Introduced in R2012a
See Also
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは 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)