How do I find out if my matrix contains only one non-zero element and return true, if not false.
Such that
0 0 00 0 00 0 0
should return FALSE(all element are zero)
0 0 00 0 10 0 1
should return FALSE(more than one element is non-zero)
And finally;
0 0 00 0 00 0 1
should return TRUE
I could use a for loop but i was wondering if there is any function that can do that
Best Answer