Download mcc - Parent Directory
Transcript
mwArray Real()
Purpose
C++
Syntax
Return mwArray that references real part of complex array
#include "mclcppclass.h"
double rdata[4] = {1.0, 2.0, 3.0, 4.0};
double idata[4] = {10.0, 20.0, 30.0, 40.0};
mwArray a(2, 2, mxDOUBLE_CLASS, mxCOMPLEX);
a.Real().SetData(rdata, 4);
a.Imag().SetData(idata, 4);
Arguments
None
Return
Value
An mwArray referencing the real part of the array.
Description
Use this method to access the real part of a complex array. The returned
mwArray is considered real and has the same dimensionality and type
as the original.
Complex arrays consist of Complex numbers, which are 1 X 2 vectors
(pairs). For example, if the number is 3+5i, then the pair is (3,5i). An
array of Complex numbers is therefore two dimensional (N X 2), where
N is the number of complex numbers in the array. 2+4i, 7-3i, 8+6i
would be represented as (2,4i) (7,3i) (8,6i). Complex numbers
have two components, real and imaginary.
The MATLAB functions Real and Imag can be applied to an array of
Complex numbers. These functions extract the corresponding part of
the Complex number. For example, REAL(3,5i) == 3 and IMAG(3+5i)
== 5. Imag returns 5 in this case and not 5i. Imag returns the
magnitude of the imaginary part of the number as a real number.
D-76
Related documents
MATLAB Compiler
MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE User`s guide
MATLAB BUILDER JA 2 User`s guide
PEAXACT Application Server - User Manual
MATLAB Compiler User`s Guide
MATLAB APPLICATION DEPLOYMENT - WEB EXAMPLE GUIDE User`s guide
User Manual for the DREAM Toolbox Version 2.1.3 An ultrasound
MATLAB Compiler User`s Guide
MATLAB POLYSPACE 7 Installation guide