B = prod(A)
将A矩阵不同维的元素的乘积返回到矩阵B。
如果A是向量,prod(A)返回A向量的乘积。
如果A是矩阵,prod(A)将A看作列向量,返回每一列元素的乘积并组成一个行向量B。
fft2
fft2函数用于数字图像的二维傅立叶变换,如:
i=imread('e:\w01.tif');
j=fft2(i);
x0=-3:3;
y0=-2:2;
[x,y]=ndgrid(x0,y0)
x =
-3 -3 -3 -3 -3
-2 -2 -2 -2 -2
-1 -1 -1 -1 -1
0 0 0 0 0
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
y =
-2 -1 0 1 2
-2 -1 0 1 2
-2 -1 0 1 2
-2 -1 0 1 2
-2 -1 0 1 2
-2 -1 0 1 2
-2 -1 0 1 2
[x,y] =
-3 -3 -3 -3 -3 -2 -1 0 1 2
-2 -2 -2 -2 -2 -2 -1 0 1 2
-1 -1 -1 -1 -1 -2 -1 0 1 2
0 0 0 0 0 -2 -1 0 1 2
1 1 1 1 1 -2 -1 0 1 2
2 2 2 2 2 -2 -1 0 1 2
3 3 3 3 3 -2 -1 0 1 2
circshift
https://ww2.mathworks.cn/help/matlab/ref/circshift.html
listing = dir(name)
dir函数的作用:返回文件夹中的所有文件或者文件夹所组成的列表。
dir %returns a list of files and folders in the current folder.
dir name %returns a list of files and folders that match the string name. When name is a folder, dir lists the contents of the folder. Specify name using absolute or relative path names,当name是一个文件夹时,返回文件夹中所有内容
listing = dir(name) % returns attributes about name.返回name的属性,是一系列结构体类型的数组。
例如>>a=dir('my_dir')
61x1 struct array with fields:
name
date
bytes
isdir
datenum
例,我们想知道该文件夹下第三个文件的名字,即就是访问该结构体中的name成员
>>a.name(3)
ans =
xxx.jpg %假设是文件名为xxx.jpg
该函数的输入类型是字符串类型string,输出为结构体数组
n = numel(A);
n= numel(A,条件);
返回数组A中元素个数。若是一幅图像,则numel(A)将给出它的像素数。
A = imread(filename)
从 filename
指定的文件读取图像,并从文件内容推断出其格式。如果 filename
为多图像文件,则 imread
读取该文件中的第一个图像。
B = conj(A)
conj函数:用于计算复数的共轭值
用法说明:y=conj(x)函数计算复数x的共轭值。输出结果y的维数跟输入x的维数一致,返回值为:real(y)-i*imag(y)