if variable is a matrix then ignore

2 ビュー (過去 30 日間)
AA
AA 2015 年 2 月 18 日
編集済み: Erik S. 2015 年 2 月 18 日
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 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by