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?

 采纳的回答

Erik S.
Erik S. 2015-2-18
编辑:Erik S. 2015-2-18
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

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by