In MatLab environment, how can one convert Logical to matrix form?
For example, consider the logical below:
[0 1 0 1] [0 0 1 0] [1 0 1 1] [0 1 0 0]
Say Logical array is called LA, Try
double(LA)
If LA is an array of arrays, as I imagine from your question, you could use:
NA = zeros(size(LA))
for i = 1:size(LA,2)
NA(i,:) = LA(i)
end
There is a compact way of doing the conversation of logical matrix LA:
NA = +LA;
And if you are dealing with cell arrays of logical arrays you can use
NA = cellfun(@uplus, LA);