How could it be determined one array of a cell containing an string or a number?

1 回表示 (過去 30 日間)
There is a cell, contains both numbers and strings, now How could it be determined one array of a cell containing an string or a number?

採用された回答

Walter Roberson
Walter Roberson 2011 年 9 月 23 日
If it contains a string, then ischar() would be true for it. If it contains a number, then isnumeric() would be true for it.
Note: data of type logical, such as the result of 1 < 5, is not numeric for the purposes of isnumeric(); islogical() works for it.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by