MATLAB Answers


Check the matrix result

Asked by Light
on 6 Jun 2013

How can i check the entire matrix zero or not




No products are associated with this question.

2 Answers

Answer by Walter Roberson
on 6 Jun 2013
 Accepted answer


will be true if M is entirely 0

I am not sure if your (sum) is intended to convey anything? Are you asking whether the sum over M is 0? If so then,

if ~sum(M(:))

Note, though, that this would be subject to round-off and cancellation problems; there are other techniques to use if you need to be concerned about those.


Answer by Matt J
on 6 Jun 2013



Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!