function y = foo() coder.extrinsic('sqrt') x = 1 + 0i; % x is complex y = sqrt(x); % x is real, y is real end Functions that take complex arguments but produce real results return real values. y = real(x); % y i
Input Arguments collapse all Input array, specified as a vector or matrix. Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|logical|char|string|struct|cell|categorical|datetime|duration|calendarDuration Complex Number Support:Yes ...
Input Arguments collapse all Input array, specified as a scalar, vector, matrix, multidimensional array, table, or timetable. Data Types:single|double|table|timetable Complex Number Support:Yes Output Arguments collapse all Exponential values, returned as a scalar, vector, matrix, multidimensional arr...
Prototype, specified as a numeric variable. Data Types: double | single | logical | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 Complex Number Support: Yes Output Arguments collapse all I— Identity matrix scalar | matrix Identity matrix, returned as a scalar or...
For an example, see Using Buses with Legacy Functions Having Structure Arguments. To generate data type objects and enumeration classes that correspond to custom data types that your C code defines, use the Simulink.importExternalCTypes function. A bus element can be complex, ...
Find the complex conjugate of each complex number in matrixZ. Zc = conj(Z) Zc =2×2 complex0.0000 + 1.0000i 2.0000 - 1.0000i 4.0000 - 2.0000i 0.0000 + 2.0000i Input Arguments collapse all Input array, specified as a scalar, vector, matrix, or multidimensional array.conjoperates element-wi...
Output Arguments collapse all Complex array, returned as a scalar, vector, matrix, or multidimensional array. The size ofzis the same as the input arguments. The following describes the data type ofzwhenaandbhave different data types.
Logical arrays also are created by the relational operators (==,<,>,~=, etc.) and functions likeany,all,isnan,isinf, andisfinite. Extended Capabilities expand all C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™. ...
y = 1×3 complex 1.0002 + 0.0000i 0.2590 + 0.0337i 0.1739 + 0.0516i Input Arguments collapse all X— Angle in degrees scalar value | vector | matrix | multidimensional array | table | timetable Angle in degrees, specified as a real-valued or complex-valued scalar, vector, matrix, multidi...
Input Arguments collapse all a— Real component of complex scalar scalar Real component of a complex scalar, specified as a scalar. Data Types: single | double b— Imaginary component of complex scalar scalar Imaginary component of a complex scalar, specified as a scalar. If b is double, you...