||
好记忆不如烂笔头,坚持将自己遇到的经常要用到但又常忘的命令记下来,以防今后遇到相同问题而苦苦求索。
ind2rgb
Convert indexed image to RGB image
Syntax
RGB = ind2rgb(X,map) %例如:[X, map]= imread(filename);
Description
RGB = ind2rgb(X,map) converts the matrix X and corresponding colormap map to RGB (truecolor) format.
ind2gray, rgb2gray, mat2gray, and so on.
meshgrid
Generate X and Y arrays for 3-D plots
Syntax
[X,Y] = meshgrid(x,y)
[X,Y] = meshgrid(x)
[X,Y,Z] = meshgrid(x,y,z)
Description
repmat
Replicate and tile array
Syntax
B = repmat(A,m,n)
B = repmat(A,[m n])
B = repmat(A,[m n p...])
Description
B = repmat(A,m,n) creates a large matrix B consisting of an m-by-n tiling of copies of A. The size of B is [size(A,1)*m, (size(A,2)*n]. The statement repmat(A,n) creates an n-by-n tiling.
B = repmat(A,[m n]) accomplishes the same result as repmat(A,m,n).
B = repmat(A,[m n p...]) produces a multidimensional array B composed of copies of A. The size of B is [size(A,1)*m, size(A,2)*n, size(A,3)*p, ...].
unique
Find unique elements of vector
Syntax
b = unique(A)
b = unique(A, 'rows')
[b, m, n] = unique(...)
[b, m, n] = unique(..., occurrence)
Description
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-6-5 22:34
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社