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

Thread Subject:
check if matrix contains zero or not

Subject: check if matrix contains zero or not

From: Rahul Singhal

Date: 13 May, 2010 07:56:19

Message: 1 of 3

Hi All,

I want to check whether any element of matrix is zero or not.

Thanks
Rahul

Subject: check if matrix contains zero or not

From: Oleg Komarov

Date: 13 May, 2010 08:07:03

Message: 2 of 3

"Rahul Singhal" <rsinghalomatic@gmail.com> wrote in message <hsgbb3$ik7$1@fred.mathworks.com>...
> Hi All,
>
> I want to check whether any element of matrix is zero or not.
>
> Thanks
> Rahul

help all

Example:

A = round(rand(10));
~all(A(:))

Oleg

Subject: check if matrix contains zero or not

From: us

Date: 13 May, 2010 09:51:04

Message: 3 of 3

"Rahul Singhal" <rsinghalomatic@gmail.com> wrote in message <hsgbb3$ik7$1@fred.mathworks.com>...
> Hi All,
>
> I want to check whether any element of matrix is zero or not.
>
> Thanks
> Rahul

a hint:
- besides ANY already mentioned by oleg...

     help nnz;

us

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us