Deconstruct values (like a zipcode) into individual segments
Versione 1.0.0 (1,62 KB) da
Jeff Burkey
This function will extract out each digit (as defined by the user) from a value for further use. For example, like a zip code or HRU.
Deconstructs values into discrete digits for attributes
This function will deconstruct a value (like a zipcode). Each digit in the
value has a specific meaning. This function will parse out each segment
(can be 1 or more digits for a given segment) to an array of
segments (digits) generated from each value (e.g., zipcode).
The function assumes all entered values have the same structure of digits
describing the decimal place.
example input:
a = [22115200; 20138285; 8130688];
b = [2,1,1,3,1]
NOTE: b must be a valid array for all values input in 'a'
example output is:
f= [22 1 1 520 0;20 1 3 828 5;8 1 3 68 8];
There might be a more elegant way to use a more sophisticated approach,
but it gets the job done and does not use loops.
Nov 25, 2025- J. Burkey
Cita come
Jeff Burkey (2025). Deconstruct values (like a zipcode) into individual segments (https://it.mathworks.com/matlabcentral/fileexchange/182679-deconstruct-values-like-a-zipcode-into-individual-segments), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2024b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxTag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
| Versione | Pubblicato | Note della release | |
|---|---|---|---|
| 1.0.0 |
