MATLAB:what's the mean of empty vector?

what's the mean of empty vector?

2 comentarios

This vector has two elements:
[1,2]
This vector has one element:
[1]
This vector has no elements:
[]
Therefore it is empty.
Lan
Lan el 16 de Mzo. de 2015
I know, thanks!

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 15 de Mzo. de 2015
Editada: Star Strider el 15 de Mzo. de 2015
A vector with no elements in it. You can create one:
v = [];
or, if the result of an operation, for instance find, has no dlements in an argument vector that meet the logical conditions in it, it will return an empty vector:
v = [1 2 3 4];
f = find(v > 4);
produces:
f =
Empty matrix: 1-by-0
If you’re talking about the arithmetic mean:
m = mean(f)
the answer is:
m =
NaN

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

Lan
el 15 de Mzo. de 2015

Comentada:

Lan
el 16 de Mzo. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by