I use MATLAB and I have to make the following pairing:
I have an array with integers:
A = [1 0 1 0 1]
and an array of the same dimension, with strings:
B = ['a' 'b' 'c' 'd' 'e']
I need to create a string array, C
, where for every element of matrix A
that is 0
the corresponding element of matrix C
is blank (''
) but for every element of matrix A
that is 1
, the corresponding element of matrix C
is equal with the corresponding element of B
.
i.e. the array C
would be :
C = ['a' '' 'c' '' 'e']