Borrar filtros
Borrar filtros

isempty

5 visualizaciones (últimos 30 días)
REN
REN el 6 de Mzo. de 2011
Hello, could anyone point out how to check a empty set?
I try isempty, seems wrong
a = [1 3 2]
a =
1 3 2
K>> b = [1 3 2]
b =
1 3 2
K>> d = setdiff(a, b)
d =
Empty matrix: 1-by-0
K>> isempty(d)
ans =
Empty matrix: 1-by-0
  5 comentarios
REN
REN el 6 de Mzo. de 2011
thanks Matt Tearle
Matt Tearle
Matt Tearle el 6 de Mzo. de 2011
OK, never mind then

Iniciar sesión para comentar.

Respuesta aceptada

Matt Tearle
Matt Tearle el 6 de Mzo. de 2011
Problem seems to have been resolved (see above comments), but for the record:
isempty(x)
Another possibility would be
~numel(x)

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by