EXPAND

버전 1.1.0.0 (1.88 KB) 작성자: Matt Fig
Replicate and tile each element of an array.
다운로드 수: 2.6K
업데이트 날짜: 2009/6/24

라이선스 보기

편집자 메모: This file was selected as MATLAB Central Pick of the Week

EXPAND(A,SZ), for array A and vector SZ replicates each element of A by SZ. The results are tiled into an array in the same order as the elements of A, so that the result is size: size(A).*SZ.

Therefore the number of elements of SZ must equal the number of dimensions of A, or in MATLAB syntax:

length(size(A))==length(SZ)

must be true.
The result will have the same number of dimensions as does A.
There is no restriction on the number of dimensions for input A.

Examples:

>> A = [1 2;3 4]
A =
1 2
3 4
>> expand(A,[2 1])
ans =
1 2
1 2
3 4
3 4
>> expand(A,[2 2])
ans =
1 1 2 2
1 1 2 2
3 3 4 4
3 3 4 4

Please email me if bugs are found in the code. Thanks.

인용 양식

Matt Fig (2024). EXPAND (https://www.mathworks.com/matlabcentral/fileexchange/24536-expand), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Matrices and Arrays에 대해 자세히 알아보기
도움

받음: REPLICATE

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Added kron to the see also list.

1.0.0.0