matlab中的数据类型和显示精度

这篇博客介绍了MATLAB中的各种数据类型,包括double、single、logical等,并讲解了如何使用CLASS函数来获取对象的类。此外,还讨论了显示格式的设置,如FORMAT SHORT和FORMAT LONG对浮点数的影响,以及如何用VPA进行高精度计算。最后,提到了MATLAB能够表示的最小实数和EPS常量在判断浮点数相等性中的作用。
摘要由CSDN通过智能技术生成

;==========================================

>> help class
 CLASS  Return class name of object.
    S = CLASS(OBJ) returns the name of the class of object OBJ.
 
    Possibilities are:
      double          -- Double precision floating point number array
                         (this is the traditional MATLAB matrix or array)
      single          -- Single precision floating point number array
      logical         -- Logical array
      char            -- Character array
      cell            -- Cell array
      struct          -- Structure array
      function_handle -- Function Handle
      int8            -- 8-bit signed integer array
      uint8           -- 8-bit unsigned integer array
      int16           -- 16-bit signed integer array
      uint16          -- 16-bit unsigned integer array
      int32           -- 32-bit signed integer array
      uint32          -- 32-bit unsigned integer array
      int64           -- 64-bit signed integer array
      uint64          -- 64-bit unsigned integer array
      <class_name>    -- MATLAB class name for MATLAB objects
      <java_class>    -- Java class name for java objects
 
    %Example 1: Obtain the name of the class of value PI
    name = class(PI);
 
    %Example 2: Obtain the full name of a package-based java class
    import java.lang.*;
    obj = String('mystring');
    class(obj)
 
    For classes created without a CLASSDEF statement (pre-MATLAB version
    7.6 syntax), CLASS invoked within a constructor method creates an
    object of type 'class_name'.  Constructor methods are functions saved
    in a file named <class_name>.m and placed in a directory named
    @<class_name>.  Note that 'class_name' must be the second argument to
    CLASS.  Uses of CLASS for this purpose are shown below.
 
    O = CLASS(S,'class_name') creates an object of class 'class_name'
    from the structure S.
 
    O = CLASS(S,'class_name',PARENT1,PARENT2,...) also inherits the
    methods and fields of the parent objects PARENT1, PARENT2, ...
 
    O = CLASS(struct([]),'class_name',PARENT1,PARENT2,...), specifying
    an empty structure S, creates an object that inherits the methods and

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值