How Does the Command “ChannelToArray ” in DIAdem Looks Like?

Updated May 31, 2023

Reported In

Software

  • DIAdem

Other

 

 

Issue Details

If I use this command “ChannelToArray” in DIAdem, what might be in the array? Is it only one column, which includes all the measurement data, or is there a second column, which includes the time channel?

For example:
[ 2.4566]
[ 3.3432]
[-.24344]

Or

[Time]
[0] [2.34532]
[0.050] [2.14345]
[0.100] [-1.3453]

Or

[1] [2.34532]
[2] [2.14345]
[2] [-1.3453]

Solution

When a single channel is inputted, the result is a vector. Conversely, when multiple channels are provided, the outcome is a matrix. Hence, all the provided examples are valid possibilities.

The "ChannelToArray" function facilitates the conversion of one or multiple channels into a type-safe array, excluding any channel-specific properties such as name. The resulting array solely contains the channel values, with each column of the matrix representing a distinct channel.

Additional Information

Presented below is a DIAdem example that incorporates Python. You may utilize this example to evaluate the format and structure of the output.

channel_values = dd.ChannelsToArray("'[1]/Time','[1]/Speed'")
print(channel_values)

Example VBScript code to concatenate two channels and export its values to one-dimensional array:

set ChnResult = ChnConcatenateChannels("[1]/Time", "'[1]/Speed'", False, False, False)
dim chn_values
chn_values = ChannelsToArray(ChnResult(1))
'call YourMatlabFunction(chn_values)