• MATLAB基本数据类型


    MATLAB基本数据类型

    整数

    • int8
    • int16
    • int32
    • int64
    • 使用: a = int8(8), b = int64(a)

    浮点型

    • single
    • double

    取整

    • round
    • ceil
    • floor

    cell

    • c = {"Name", "JH"; "Age", 10};
    • cell()
    • 使用的时候使用{}, 而不是[]
    • 函数
      • struct2cell
      • celldisp
      • cellplot

    字符串

    • 就是一个字符数组, 在MATLAB中一个字符占用两个字节, 因为使用了Unicode编码
    • 函数
      • num2str

    结构体

    • stu(1).name = ?, stu(1).age = ?
    • stu(2).name = ?, stu(2).age = ?
    • 函数
      • cell2struct
      • getfields
      • setfield
      • rmfield
      • ...

    多项式

    • poly: 根据根求多项式
    • roots: 求解
    • poly2sym
    • sym2poly
    • polyval
    • ppval
    • syms x

    插值(根据已知的点求出函数, 在根据xi的值计算出xi对应的函数值, 达到样本增量的效果)

    • interp1(x, y, xi, "linear|spline|nearest")
    • interp2(x, y, z, xi, yi, "linear|spline|nearest|cubic")
    • spline(x, y, xi) == interp1(x, y, xi, "spline")
    • interpft(y, n) -> 傅里叶插值
    • interp3: 高位插值
    • interpn: n维插值

    常用命令

    • clf: 清理figure
    • home: 和clc类似
    • what: 列出当前目录下与Matlab有关的文件
    • which: 查看函数文件的绝对路径
    • delete: 删除文件
    • lookfor: 在帮助系统中查找关键字
    • save
    • load
    • exist: 判断是否存在
    • sprintf: 格式化字符串
    • repmat: 以当前矩阵为分块矩阵, 扩展
    • reshape
    • diag
  • 相关阅读:
    Windows下使用nmake编译C/C++的makefile
    poj 1228
    poj 1039
    poj 1410
    poj 3304
    poj 1113
    poj 2074
    uva 1423 LA 4255
    poj 1584
    poj 3277
  • 原文地址:https://www.cnblogs.com/megachen/p/10491489.html
Copyright © 2020-2023  润新知