MathWorks.MATLAB.NET.Arrays.MWLogicalArray Class
Namespace: MathWorks.MATLAB.NET.Arrays
Managed representation of MATLAB logical array
Description
MWLogicalArray
is the managed representation of the MATLAB logical
array. Like its MATLAB equivalent, an MWLogicalArray
contains only ones and
zeros (true/false).
As MWLogicalArray
is derived from MWIndexArray
, it
can be used in all MATLAB indexing operations.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Properties
Public Properties
ArrayType
— Derived type of MWArray
MWArrayType
This property is read-only.
Syntax
public MWArrayType ArrayType { get; }
MWArrayType
object.
Dimensions
— Return native integer array containing size of each dimension of MWArray
positive integer
Empty
— Return writeable version of empty MWLogicalArray
MWLogicalArray
This property is read-only.
Syntax
public static MWLogicalArray Empty { get; }
IsCellArray
— Flag indicating if MWArray
is MWCellArray
boolean
IsCharArray
— Flag indicating if MWArray
is MWCharArray
boolean
IsDisposed
— Handle status of encapsulated MWArray
boolean
This property is read-only.
Syntax
public virtual bool IsDisposed { get; }
IsEmpty
— Flag indicating if MWArray
is empty
boolean
IsLogicalArray
— Flag indicating if MWArray
is MWLogicalArray
boolean
IsNumericArray
— Flag indicating if MWArray
is MWNumericArray
boolean
IsScalar
— Return true of array is logical scalar
boolean
This property is read-only.
Syntax
public bool IsScalar { get; }
IsSparse
— Return true of array is sparse array
boolean
This property is read-only.
Syntax
public bool IsSparse { get; }
IsStringArray
— Flag indicating if MWArray
is MWStringArray
boolean
IsStructArray
— Flag indicating if MWArray
is MWStructArray
boolean
Item
— Generic MATLAB indexer returning result as MWArray
MWArray
Syntax
public MWArray this[
params int[] indices
] { get; set; }
Array indexing in this API, as in MATLAB®, is one-based rather than zero-based.
NonZeroMaxStorage
— Return number of storage locations allocated for nonzero elements of sparse matrix
Int32
Syntax
public int NonZeroMaxStorage { get; }
nzmax
function in the MATLAB documentation.
NumberOfDimensions
— Number of dimensions in MWArray
positive integer
NumberOfElements
— Number of elements in MWArray
positive integer
This property is read-only.
Syntax
public int NumberOfElements { get; }
prod(size(A))
for non-empty arrays. See numel
.
Methods
Constructors
These methods specialize standard MATLAB operators and functions for objects in this class.
MWLogicalArray() | Syntax public MWLogicalArray() Creates an empty logical array |
MWLogicalArray(Array) | Syntax public MWCharArray(
Array stringArray
) Constructs an m-by-n-by-p-by-... logical array from a native array of boolean values. Parameters boolArray Type: System.Array A native boolean array. The logical array will have the same dimensions and values as the native array. NOTE: As MATLAB arrays must have at least two dimensions, a single dimension native array will result in the creation of a two dimensional logical array having a single row. |
MWLogicalArray(Boolean) | Syntax public MWLogicalArray(
bool logicalValue
) Creates a logical scalar array representing the specified boolean value. Parameters value Type: System.Boolean A boolean value. |
MWLogicalArray(Int32[]) | Syntax public MWLogicalArray( params int[] dimensions ) Creates an m-by-n-by-p-by-... empty logical array. Parameters value Type: System.Int32[] A number of array dimensions. If only one dimension is specified, an empty n-by-n logical array is created. |
MWLogicalArray(Int32, Int32) | Syntax public MWLogicalArray( int row, int column ) Creates an empty m-by-n logical array. Parameters row Type: System.Int32 The number of rows in the array column Type: System.Int32 The number of columns in the array |
MWLogicalArray(SerializationInfo, Streaming,Context) | Syntax protected MWLogicalArray( SerializationInfo serializationInfo, StreamingContext context ) Internal deserialization constructor. Parameters serializationInfo Type: System.Runtime.Serialization.SerializationInfo Holds the data needed to serialize or deserialize the object. context Type: System.Runtime.Serialization.StreamingContext Describes the source and destination of the serialized stream |
MWLogicalArray(Int32, Int32, Boolean[]) | Syntax public MWLogicalArray( int rows, int columns, bool[] boolArray ) Constructs an m-by-n logical array initialized to the values contained in a native boolean array. Parameters row Type: System.Int32 The number of rows in the array column Type: System.Int32 The number of columns in the array boolArray Type: System.Boolean[] A native vector of boolean values The logical array is initialized in row major order from the values contained in the boolean vector. The number of elements in the vector array must match the number of elements in the newly created logical array (rows * columns). |
MWLogicalArray(Int32, Int32, Boolean[], Boolean) | Syntax public MWLogicalArray( int rows, int columns, bool[] boolArray, bool columnMajorOrder ) Internal deserialization constructor. Parameters row Type: System.Int32 The number of rows in the array column Type: System.Int32 The number of columns in the array boolArray Type: System.Boolean[] A native vector of boolean values columnMajorOrder Type: System.Boolean A boolean flag - true if the logical array should be initialized in column major order. The logical array is initialized in the specified order from the values contained in the boolean array. The number of elements in the array must match the number of elements in the newly created logical array (rows * columns). |
Public Methods
Clone | Syntax public virtual Object Clone() Makes
a deep copy of an |
ConvertToNativeTypes | Syntax public static Object[] ConvertToNativeTypes( MWArray[] src, Type[] specifiedTypes ) Converts an array of |
Dispose() | Syntax public void Dispose() Releases
resources of the |
Dispose(Boolean) | Syntax protected override void Dispose( bool disposing )
Internal dispose function |
Equals | Syntax public override bool Equals(
Objectobj
) Compares two |
Finalize | Inherited from |
GetHashCode | Syntax public override int GetHashCode() Returns
the hashcode of the |
GetObjectData | Syntax public virtual void GetObjectData( SerializationInfo info, StreamingContext context )
Implements ISerializable.GetObjectData(SerializationInfo, StreamingContext) Serialization function. The arguments for this function are supplied by the .NET serialization infrastructure. |
GetType | Inherited from |
MakeSparse(Int32, Int32, Int32) | Syntax public static MWLogicalArray MakeSparse( int rows, int columns, int nonZeroMax ) Parameters
Return Value Type:
The sparse logical matrix Constructs a sparse logical matrix with the specified rows and columns and storage for the specified number of non-zero elements. |
MakeSparse(Int32[],Int32[],Boolean[]) | Syntax publicstaticMWLogicalArrayMakeSparse( int[] rowIndex, int[] columnIndex, bool[] dataArray ) Parameters
Return Value Type:
The sparse logical matrix Constructs a logical sparse matrix with the number of rows= max{rowIndex(k)} and the number of columns= max{colIndex(k)}. It initializes the array with the supplied data. The maximum number of nonzero elements is equal to the length of the data array. The row and column index arrays are used to construct the sparse array such that S(rowIndex(k), columnIndex(k))= dataArray(k). |
MakeSparse(Int32, Int32,Int32[],Int32[],Boolean[]) | Syntax publicstaticMWLogicalArrayMakeSparse( int[] rowIndex, int[] columnIndex, bool[] dataArray ) Parameters
Return Value Type:
The sparse logical matrix The row and column index arrays are used to construct the sparse array such that S(rowIndex(k), columnIndex(k))= dataArray(k). |
MakeSparse(Int32, Int32,Int32[],Int32[],Boolean[],
Int32) | Syntax publicstaticMWLogicalArrayMakeSparse( int[] rowIndex, int[] columnIndex, bool[] dataArray ) Parameters
Return Value Type:
The sparse logical matrix The row and column index arrays are used to construct the sparse array such that S(rowIndex(k), columnIndex(k))= dataArray(k). |
MemberwiseClone | Inherited from |
ToArray | Syntax public virtual Array ToArray() Returns
a native .NET array containing a copy of data in the underlying MATLAB array. The
returned array has the same dimensionality as the underlying MATLAB array. The
elements of the returned array are converted according to default conversion
rules. If the underlying MATLAB array is a complex numeric type,
|
ToString | Syntax public virtual string ToString() Returns
a formatted string representing the contents of the
|
ToVector | Syntax public bool[] ToVector() Returns a copy of the elements in the logical array as a one dimension native boolean array The data is returned as a native array in the standard MATLAB column major order not the C# row major order. |
Specialized Operators and Functions
These methods specialize standard MATLAB operators and functions for objects in this class.
Implicit(Double to MWLogicalArray) | Implicit cast from native double scalar value to
|
Implicit(String to MWLogicalArray) | Implicit cast from native character string to
|
Inheritance Hierarchy
System.Object
Mathworks.MATLAB.NET.Arrays.MWArray
Mathworks.MATLAB.NET.Arrays.MWIndexArray
Mathworks.MATLAB.NET.Arrays.MWLogicalArray
Mathworks.MATLAB.NET.Arrays.MWNumericArray
Version History
Introduced in R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)