cell 数组
- 普通数组
a(:,n) 前面行后面列 冒号代表全选
a(M) M 可以是 01 矩阵,用来提取对应的位置
switch
switch ... case A, otherwise,
nargin nargout 函数调用的输入参数个数
pause pause(n) 暂停
@(参数列表)(函数表达式) 匿名函数
elseif
~= 不等于
函数
一般
sum
mean 平均值 std var
max min
sort(c,'ascend')
find 返回非零位置下标
round 四舍五入
fix 向下取整
floor ceil
input
disp
zeros
global 全局变量
power pow2
绘图
plot 绘图,可以指定很多样式
plot(x,y,x,y,...) xy 对画图
legend 产生一个图例框
title 在顶部添加标题
xlable ylable 标注坐标轴
ezplot 简易绘图
fplot 给定自变量范围
polar 极坐标绘图
bar3 条形图
hist 柱状图(热力图)
plot3 空间曲线绘制
meshgrid 生成平面网格
mesh 绘制网格
colormap([0 0 1]) 着色
meshc 有等高线
meshz 有边界
contour contour3 只绘制等高线
patch 二维三维 fill 二维 fill3 三维 多边形绘制填充
hold on/off 控制需不需要清除绘制的内容
字符串操作
char double cellstr num2str int2str mat2str str2double 格式转换
blanks(n) 创建空字符串
deblank strtrim 删除尾部空格
eval evalc 使用 matlab 解释器求解表达式
ischar isletter isspace 判断
strcat strvcat 字符串拼接
strcmp
strfind
strtok(S,D) 查找 S 中第一个给定的分隔符之前和之后的字符串
upper lower 转换大小写
sprintf sscanf
文件操作
fid = fopen fclose
fgetl fgets fprintf fscanf
矩阵操作
triu tril 矩阵的上下三角部分
inv det rank
数学函数
taylor 泰勒展开
subs 替换符号
limit 符号求解极限
diff 符号求解导数
simplify 符号化简
vpa 计算符号表达式的数值结果
compose 复合函数
int 符号计算不定积分
eig 矩阵求解 特征值与特征向量
solve 方程组符号运算求解
polyfit 多项式拟合
polyval 多项式求值
fit 拟合
roots 多项式求根
fzero 非线性方程求根
fsolve 非线性方程组求根
trapz 梯形法数值积分
quad dblquad 数值积分
integtal 自适应积分
dsolve 求解一阶常微分方程组
ode23 ode45 数值求解微分方程
fminbnd 单变量无约束最优化
fminsearch (免导数)fminunc(导数) 多变量无约束最优化问题
linprog 线性规划问题
intlinprog 混合整数线性规划问题
fmincon (非线性)多变量有约束最优化问题
ga 遗传算法求解最优化问题
unifrnd 生成连续均匀分布随机数 unidrnd 离散
rand 生成 01 区间内随机数