Al momento, stai seguendo questo contributo
- Vedrai gli aggiornamenti nel tuo feed del contenuto seguito
- Potresti ricevere delle email a seconda delle tue preferenze per le comunicazioni
CROPANDPADMATRIX pads or crops a matrix into desierd width and height
X = CROPANDPADMATRIX(MAT,OUTWIDTH, OUTHEIGHT) pads MAT, with zeros or crops the matrix,
while keeping the matrix in the middle and outputs a new matrix x with dimention
[outHeightxoutWidth]. MAT may be a cell array of matrecies, in which case,
X will be [h,w,c] array where h is the height, w is width and c is the
number of matrecies in the MAT. If the matrix is empry CropAndPadMatrix(MAT,WIDTH ,HEIGHT)
returns and zero matrix with size [HEIGHT,WIDTH].
Examples
CropAndPadMatrix(rand(5,10), 100, 10)
CropAndPadMatrix(rand(5,50), 10, 10)
CropAndPadMatrix([], 10, 10)
CropAndPadMatrix({rand(5,10),rand(51,12)}, 10, 10)
Cita come
ytzhak goussha (2026). Crop and pad a matrix (https://it.mathworks.com/matlabcentral/fileexchange/94140-crop-and-pad-a-matrix), MATLAB Central File Exchange. Recuperato .
Informazioni generali
- Versione 1.0.2 (4,89 KB)
Compatibilità della release di MATLAB
- Compatibile con qualsiasi release
Compatibilità della piattaforma
- Windows
- macOS
- Linux
