if variable is a matrix then ignore

2 visualizaciones (últimos 30 días)
AA
AA el 18 de Feb. de 2015
Editada: Erik S. el 18 de Feb. de 2015
hi guys, i get several variables. some of these variables are real numbers whilst others are matrices/vectors. I want the variables with matrices or vectors filtered our/deleted. how can i do that?

Respuesta aceptada

Erik S.
Erik S. el 18 de Feb. de 2015
Editada: Erik S. el 18 de Feb. de 2015
use the numel function to detect the number of elements in a variable.
elements = numel(variable)
if elements > 1
you have a vector or matrix

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by