what does this means.
Afficher commentaires plus anciens
can you tell me what does this means. .
repmat(okpxls, [1, 1, 3]);
and zeros(size(img), class(img));
pls reply asap. .
Réponse acceptée
Plus de réponses (1)
Wayne King
le 19 Fév 2012
repmat(okpxls,[1 1 3]) replicates (copies) an input into 3-D.
x = randn(3,1);
y = repmat(x,[1 1 3]);
y has the same row and column size as x, but has dimension 3 along the third dimension.
Another example:
x = randn(2,2);
y = repmat(x,[1 1 3]);
size(y)
zeros(size(img), class(img));
creates a matrix of zeros the same size and class as image
x1 = uint8(randn(8,8));
x2 = zeros(size(x1),class(x1));
4 commentaires
Prasad MV
le 19 Fév 2012
Wayne King
le 19 Fév 2012
if x is 2x2, then y = repmat(x,[1 1 2]) takes that 2x2 matrix and copies that matrix into 2x2x3 matrix where every 3rd dimension is just a copy of the original 2x2 matrix
x = randn(2,2);
y = repmat(x,[1 1 3]);
y is now 2x2x3 and
y(:,:,1)
y(:,:,2)
y(:,:,3)
are all equal to x
Wayne King
le 19 Fév 2012
as far as zeros()
if x has a certain class, say unsigned 8-bit integer
x = uint8(randn(2,2))
size(x)
class(x)
then
y = zeros(size(x),class(x))
creates an array, vector, etc the same size as x AND of the same class
Prasad MV
le 19 Fév 2012
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!