1、Matlab中上标用^(指数),下标用 _(下划线)
调用方式为: ^{任意字符}, _{任意字符}, 注意{}的使用!
举例figure,title('基于幂级数e^{-||x-y||} 的点云质量的分配')
2.Matlab保留小数点后面几位。
>>a=123.4567890;
>>a=roundn(a,-4)
a = 123.4568
其中roundn函数功能如下:
y = ROUNDN(x) rounds the input data x to the nearest hundredth. %不指定n,精确到百分位 y = ROUNDN(x,n) rounds the input data x at the specified power %精确到小数点后指定位数n
2、matlab@用法
类似于c++中的宏:
#define area(x) ((x)*(x))
语法: 变量名=@(输入参数列表)运算表达式
这样产生的函数句柄变量不指向特定的函数, 而是一个函数表达式
例如: