if variable is a matrix then ignore

4 vues (au cours des 30 derniers jours)
AA
AA le 18 Fév 2015
Modifié(e) : Erik S. le 18 Fév 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?

Réponse acceptée

Erik S.
Erik S. le 18 Fév 2015
Modifié(e) : Erik S. le 18 Fév 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

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by