if variable is a matrix then ignore

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?

 Akzeptierte Antwort

Erik S.
Erik S. am 18 Feb. 2015
Bearbeitet: Erik S. am 18 Feb. 2015

1 Stimme

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

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Hilfe-Center und File Exchange

Gefragt:

AA
am 18 Feb. 2015

Bearbeitet:

am 18 Feb. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by