what does this means.
이전 댓글 표시
can you tell me what does this means. .
repmat(okpxls, [1, 1, 3]);
and zeros(size(img), class(img));
pls reply asap. .
채택된 답변
추가 답변 (1개)
Wayne King
2012년 2월 19일
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
Prasad MV
2012년 2월 19일
Wayne King
2012년 2월 19일
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
2012년 2월 19일
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
2012년 2월 19일
카테고리
도움말 센터 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!