Hi everyone. A month ago I had this same question but for regular arrays. Now I am trying to extend my reasoning to tall arrays. Context:
What I would like to do is:
1. Count the number of elements that fall under certain range on a per column basis (say, elements between 0 and 0.5)
2. Assign that count to an element of a different matrix
3. Repeat steps 1 and 2 using a new range (say, elements between 0.5 and 1.0)
4. Repeat steps 1 through 3 for all columns
Count values between 0 and 0.5, and 0.5 and 1.0 in matrix A and assign the results to matrix B.
The answer then (link) was
[ra, ca] = size(A)
ranges = [0, 0.5;
[rr, cr] = size(ranges);
B = zeros(rr, ca)
for row = 1 : rr
B(row, :) = sum(A > ranges(row, 1) & A <= ranges(row, 2), 1)
But what if matrix A is now a tall array? Here is what I've done that is not working:
ranges = [ranges_edge1,ranges_edge2];
[row_ranges, cr] = size(ranges);
B = zeros(row_ranges, n);
for row = 1 : row_ranges
B(row, :) = sum(A > ranges(row, 1) & A <= ranges(row, 2), 1);
At this point I get the error
The following error occurred converting from tall to double: Conversion to double from tall is not possible.
B(row, :) = sum(out > ranges(row, 1) & out <= ranges(row, 2), 1);
What can I do to continue? Hope anyone can help. Cheers!