I have a 21x19 matrix B
Each index of the matrix is either 1,0, or -1. I want to count the number of occurrences for each row and column. Performing the column count is easy:
Colcount = sum( B == -1 );
Colcount = sum( B == 0 );
Colcount = sum( B == 1 );
However accessing the other dimension to attain the row counts is proving difficult. It would be great of it could be accessed in one statement. Then i need to use a fprintf statement to print the results to the screen.