找到你要的答案

Q:Unknown “feature” function

Q:未知的“特征”功能

I'm totally new to MATLAB, and I have dificulties with some code I have to understand for my project.

Here is the code :

feature         = feature(1:64,:,:);
feature(43,:,:) = [];
feature(33,:,:) = [];
feature         = feature([36,38,45,46,47,53,54,55,59,60,61],:,:);

I don't realy understand what does the feature function does or is. Is it a table? A matrix? And what does (1:64,:,:) mean? The same for (43,:,:)? Is it a MATLAB notation ? Where can I find a sum up of these notations?

我对MATLAB的全新的,和我有困难的一些代码我已经了解我的项目。

这里是代码:

feature         = feature(1:64,:,:);
feature(43,:,:) = [];
feature(33,:,:) = [];
feature         = feature([36,38,45,46,47,53,54,55,59,60,61],:,:);

我不真的明白什么是特征函数或。这是一张桌子吗?一个矩阵?什么(1:64,:,:)是什么意思?相同的(43,,::)这是一个MATLAB的符号?我在哪里可以找到这些符号的总结?

answer1: 回答1:

the variable feature is a multidimensional matrix of dimension 3 (aka 3D array, e.g. RGB image). In fact, almost everything in Matlab is a matrix.

And what does (1:64,:,:) mean?

This says take elements from 1:64 along the first dimension of the variable. 1:64 expands to [1, 2, 3, ..., 64]

feature now has size 64xNxK

The same for (43,:,:) ?

This says give me the elements at row 43

When you say

feature(43,:,:) = []

you delete this row from the matrix. Now the matrix size is one row less.

See here for the documentations http://www.mathworks.com/help/matlab/math/matrix-indexing.html

变量的特征是一个多维矩阵的维数3(又名三维阵列,如RGB图像)。事实上,几乎所有的东西都是在MATLAB的矩阵。

什么(1:64,:,:)是什么意思?

这表示把元素从1:64沿第一维的变量。1:64扩展到[ 1,2,3,…,64 ]

目前有大小64xnxk

相同的(43,,::)

这说给我在第43行的元素

当你说

feature(43,:,:) = []

从矩阵中删除此行。现在矩阵的大小是一行少。

在这里看到的文件http://www.mathworks.com/help/matlab/math/matrix-indexing.html

matlab