如何在MATLAB中获取变量的类型?
 MATLAB是否有一个函数/运算符指示变量的类型(类似于JavaScript中的typeof运算符)? 
使用class功能
>> b = 2
b =
     2
>> a = 'Hi'
a =
Hi
>> class(b)
ans =
double
>> class(a)
ans =
char
  class()函数相当于typeof() 
  您也可以使用isa()来检查变量是否属于特定类型。  如果你想要更具体,你可以使用ischar() , isfloat() , iscell()等。 
  另一个相关的功能是whos 。  它将列出给定工作空间中变量的各种信息(维度,字节大小,类型)。 
>> a = [0 0 7];
>> whos a
  Name      Size            Bytes  Class     Attributes
  a         1x3                24  double              
>> b = 'James Bond';
>> whos b
  Name      Size            Bytes  Class    Attributes
  b         1x10               20  char 
