Deconstruct values (like a zipcode) into individual segments

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.

You are now following this Submission

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

Cite As

Jeff Burkey (2026). Deconstruct values (like a zipcode) into individual segments (https://ch.mathworks.com/matlabcentral/fileexchange/182679-deconstruct-values-like-a-zipcode-into-individual-segments), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0