内置基本功能及其函数介绍
数据处理与计算
flipdim, reshape, repmat, permute, squeeze
find, isnan, isempty, iscell, all, any
ismember, intersect, union, setdiff
unique, sort, sortrows
inpolygon, polybool, polyjoin, polysplit
数学函数和统计函数
Interp1, interp2, interpn, griddata, TriScatteredInterp
spline, smooth, smooth3, cspas, polyfit, regress, quad, trapz, integral
mean, nanmean, std, corrcoef, prctile
pdf, normpdf, tpdf, tcdf, tinv
eig, svd, pca, fft, dwt, pmtm
常用字符串处理函数
将数字或其它类型数据转化成字符串:
sprintf, num2str, mat2str, int2str, char
字符串与其它类型数据转化:
strread, textscan, sscanf, str2num
字符串比较:
strfind, strmatch, strcmp, strcmpi, strrep
正则表达式匹配:
regexp,regexpi, regexprep
其它:
cellstr, cellfun;strjust, strtrim; strcat, strvcat
矩阵处理的大部分方法和函数也适用于字符串处理
日期/时间相关函数
最常用的几个日期/时间函数:
datenum: 计算某时间相对于参考点(‘Jan-0-0000 00:00:00’)的天数;
datevec: 将某时间转换为数据向量[Y, M, D, H, MN, S];
datestr:将某时间转换为特定格式的时间字符串
datetime: 日期时间类的构造函数
其它日期和时间函数:
year, month, day, weekday, days365
date, clock
yeardays, daysadd, daysdif
NumDays = daysdif(StartDate, EndDate, Basis)
(Basis=7, no leap year)
各类文件操作
ASCII文件(文本文件)
fopen, fclose, fscanf, fprintf, fgetl
textread, textscan, dlmread, dlmwrite
load
BINARY文件
fopen, fclose, fseek, fread, fwrite
NetCDF文件
MATLAB内置的netcdf库函数
ncinfo, nccreate, ncread, ncwrite
netcdf.open, netcdf.close, netcdf.create, netcdf.inqVar, netcdf.getVar
NetCDF4/HDF5文件压缩参数:Shuffle: true/false; DeflateLevel:0-9
Excel文件
xlsread,xlswrite,xlsfinfo
shapefile
shaperead, shapewrite, shapeinfo
HDF5
h5disp, h5read, h5write
图形绘制及控制函数简介
图形、坐标轴
figure, hold, axes, axesm, subplot
axis, title, xlabel, ylabel, xlim, ylim
clf, cla, gcf, gca, gco, findobj
colormap, colorbar, caxis
text, gtext, annotation
legend
曲线、散点图
plot, plot3, line, plotyy, semilogx, semilogy
scatter scatter3
直方图、面积图,饼图
bar, bar3, barh, bar3h,
hist, histc, area,
pie, pie3, rose
Error Bar图
errorbar
等值线、填充等值线
contour, contour3, contourc, contourf, clabel
方块填充图
pcolor, image, imagesc
流线、风矢量
streamline, streamslice, quiver
三维图形
surf, surfl, mesh, sphere, cylinder, trisurf
其它:
fill, fill3, patch, shading
图形和图象输出
saveas, print;
getframe, imwrite
支持的常用图形格式:
BMP,JPG,TIFF,PNG,GIF
EMF,EPS,PDF