CATALIGN

Version 2.10.0 (5,31 ko) par Andres
cat / concatenate and align (left-, right-justify or center) numbers / text / ... in any dimension with padding
9 téléchargements
Mise à jour 13 oct. 2022

Afficher la licence

catalign concatenates variables in any dimension regardless of their sizes by padding them up to the minimum required length.
Some Examples:
· concatenate variables with non-matching sizes along dimension 1, padding with zeroes.
>> x = catalign(1,0,[1 2],[3;4;5])
x =
1 2
3 0
4 0
5 0
· place three vectors/arrays to a separate page, padded with NaNs, align to the highest indices
>> x = catalign(-3,NaN,[1 2 3],[4 5;6 7],[8;9])
x(:,:,1) =
NaN NaN NaN
1 2 3
x(:,:,2) =
NaN 4 5
NaN 6 7
x(:,:,3) =
NaN NaN 8
NaN NaN 9
· concatenate char arrays, right-justified
>> x = catalign("r",' ',{'right-','justified','text'})
x =
' right-'
'justified'
' text'
· mix images
% Concatenate rgb image data along dimension 4, with center alignment for
% dimension 1 and right alignment for dimension 2
pel = uint8(0);
dm = [0.5 -1 1 0];
impepp = imread('peppers.png');
imcorn = imread('corn.tif',2);
imcope = catalign(dm,pel,impepp,imcorn);
figure, imshow(max(imcope,[],4))

Citation pour cette source

Andres (2024). CATALIGN (https://www.mathworks.com/matlabcentral/fileexchange/94025-catalign), MATLAB Central File Exchange. Extrait(e) le .

Compatibilité avec les versions de MATLAB
Créé avec R2021a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Remerciements

Inspiré par : PADCAT

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
2.10.0

- added output TF to indicate concatenated values as opposed to padded values
- fixed bug: return SI for single concatenation argument
- SI cell elements (with start and end indices) are now row vectors instead of column vectors

1.1.1

image added

1.1.0

dim may be a vector for varying alignment per dimension

1.0.0