现在的位置: 首页 > 综合 > 正文

The cmd of matlab

2013年12月04日 ⁄ 综合 ⁄ 共 2786字 ⁄ 字号 评论关闭

记录一下自己遇到的不常用的matlab command:

【1】 tabulate: Frequency table

【2】union, intersect, setdiff, all, any,

【3】ismember, isfloat, isfield,exist(这个可以判断变量是否存在), isreal

【5】nargin, nargout, varargin, varargout, narginchk

【6】chol, lu

【7】str2num

【8】ndims

【9】mod 与rem

【10】keyboard 与pause

【11】sprintf

【12】strcat

【13】bwlabel, bwmorph, bwboundaries, regionprops(区域描述子。。)

【14】histc, histeq(直方图均衡)

【15】rgb2gray

【16】 rem与mod(与mode区别)

【17】sub2ind, ind2sub

【18】inpolygon, polyxpoly(求两个线段的交点的利器)

【19】bwareaopen

【20】 spcrv (平滑好函数), spline

【21】 im2bw 

【22】cellfun

【23】rgb2ycbcr

【24】cat

【25】permute

【26】squeeze, shiftdim

【27】 imag, real

【28】 size,  numel(这个太好用了), length, prod

【29】 mat2gray

【30】colorspace,功能很强大,尤其是可以转换LAB<-RGB

【31】median(中值)

【32】any

【33】padarray

【34】ksdensity

【35】imwrite (以前知道save保存,但图片就忘了这个命令了。。)和print(也是保存图片的)print(gcf, '-deps', fileName) 和printf(gcf, '-depsc', fileName),这里面有一个参数-r<number>,可以控制dpi

【36】isempty(这个命令也会忘。。。)

【37】cell2mat(超级好用)

【38】entropy

【39】downsample

【40】imnoise(给图像加噪声的)

【41】filter2,conv2,imfilter, ordfilt2(功能超级强大), medfilt2

【42】atan2, atan, atan2d

【43】logspace

【44】im2double

【45】meshgrid

【46】bsxfun ,  blkproc, inline

【47】fspecial, imfilter

【48】triu,tril, diag 它不仅可以取别的矩阵的对角线,也可以用向量产生矩阵。

【49】eig

【50】sign

【51】checkerboard, makeform

【52】repmat, reshape

【53】sparse注意这里有个性质( Any elements of s that have duplicate values of i and j are added together), full, spdiags

【54】cumsum

【55】convhull(凸包洛), inploygon(判断一个点是否在一个多边形中)

【56】dsolve(里面有一个解微分方程组的例子不错), ode45

【57】ployfit

【58】optimtool(优化工具箱)

【59】quadl

【60】kstest假设检验

【61】im2col, col2im,这两个命令还是不太熟悉。

【62】gradient, diff

【63】class, cast

File:

【1】filesep

【2】fullfile

【3】fileparts

【4】tempdir

【5】fgetl(读取不同行长度txt数据的利器啊)

【6】textscan, xlsread

[7] cd, pwd, mkdir, dir dir([path '/*.tif'])(可以读取该文件下所有.tif的文件)

Time:

[1] date

[2] datevec

[3] datestr

Str:

[1] strcat

[2] strfind

[3] strrep

[4] num2str

Figure:

[1] plot

[2] line

[3] fill

[4] imshow, imagesc(貌似功能要强大些。。。), image之间的区别,不知道

[5] axis, caxis, set(gca,'ydir','reverse') (让y轴翻转), xlabel, set(gca,'xtick',1:100,'xticklabel',mod(1:10,10))可以改变坐标刻度和刻度值 set(get(gca, 'XLabel'), 'Rotation', 15); 让label旋转set(h,'Fontsize',6); 设置句柄字体大小

[7] whitebg

[8] gplot

[9] waitbar 

[10] quiver, colorbar, surf, contour, mesh, view (查看的角度), set(gcf, 'edgecolor','none') 和shading interp可以去掉surf绘制曲面的网格线

[11] errorbar

[12] uicontrol

[13] polar极坐标作图

[14] grid, box, axis

[15] h=xlabel('x轴的标签');get(h) 这个可以得到xlabel的属性值get句柄可以查看这个句柄的具体属性 ylabel('$S_{2}$');set(get(gca, 'YLabel'), 'FontSize', 20, 'Interpreter', 'LaTex');这样可以调用latex编译器。

[16] gca 当前轴的句柄,gcf 当前图像的句柄

[17] set(ih, 'AlphaData', Am) 这个可以设置图像的透明度

[18] text 在图上写文字

[19] print输出图像大小调整http://blog.sciencenet.cn/blog-615126-499084.html

display:

[1] disp

[2] sprintf  其中的\t可以产生horizontal tab,相当于一个大空格

[3] fprintf, clock

[4] error, assert

----------------------------------

[1] naivebayes

[2] classdef

Interaction:

[1] ginput

------- GUI --------------------------

[1] uicontrol(控件对象),uimenu(生成菜单),uicontextmenu(右键生成菜单), uipanel

[2] gcf, gca, gco, gcbf, gcbo, findobj, get, set . 获得句柄

[3] msgbox(弹出消息框)

[4] guide, guidata

抱歉!评论已关闭.