Matlab论坛
直播中

study875

12年用户 1157经验值
私信 关注

isa - Determine whether input is object of given class matlab

本帖最后由 study875 于 2012-4-20 09:17 编辑
  1. Syntax
  2. K = isa(obj, 'class_name')

  3. Description
  4. K = isa(obj, 'class_name') returnslogical 1 (true) if obj isof class (or a subclass of) class_name,and logical 0 (false) otherwise.

  5. The argument obj is a matlab objector an object of the Java programming language. The argument class_name isthe name of a MATLAB (predefined or user-defined) or a Java class.Predefined MATLAB classes include

  6. logical

  7. Logical array of true and false values

  8. char

  9. Characters array

  10. numeric

  11. Integer or floating-point array

  12. integer

  13. Signed or unsigned integer array

  14. int8

  15. 8-bit signed integer array

  16. uint8

  17. 8-bit unsigned integer array

  18. int16

  19. 16-bit signed integer array

  20. uint16

  21. 16-bit unsigned integer array

  22. int32

  23. 32-bit signed integer array

  24. uint32

  25. 32-bit unsigned integer array

  26. int64

  27. 64-bit signed integer array

  28. uint64

  29. 64-bit unsigned integer array

  30. float

  31. Single- or double-precision floating-point array

  32. single

  33. Single-precision floating-point array

  34. double

  35. Double-precision floating-point array

  36. cell

  37. Cell array

  38. struct

  39. Structure array

  40. function_handle

  41. Function handle

  42. 'class_name'

  43. MATLAB class or Java class

  44. To check for a sparse array, use issparse.To check for a complex array, use ~isreal.

  45. Examples
  46. isa(rand(3,4),'double')
  47. ans =
  48.     1
  49. The following example creates an instance of the user-defined MATLAB classnamed polynom. The isa functionidentifies the object as being of the polynom class.

  50. polynom_obj = polynom([1 0 -2 -5]);
  51. isa(polynom_obj, 'polynom')
  52. ans =
  53.      1
引用: 有没有高手给翻译下?

更多回帖

发帖
×
20
完善资料,
赚取积分