We have a series of addresses like the following which we'd like to reformat. All the addresses are in the Boston area of Massachusetts (MA) and should have a leading '0' before the 2 in the zip code. Can you insert the leading '0'?
Example:
Input: adrIn = '950 Blue Hill Ave.Dorchester, MA 2124';
Output: adrOut = '950 Blue Hill Ave.Dorchester, MA 02124';
Feature Tip:
R2016b introduces string arrays and text manipulation functions which can help. To learn more see MATLAB Characters and Strings.
Background:
Did you know the city of Boston has a number of urban orchards? This data comes form a list of these orchards. We're trying to reformat the addresses into a standard form. You can see the data here or import it into MATLAB with webread.
data = webread('https://data.cityofboston.gov/api/views/byxy-288e/rows.csv');
Related Problems:
Use R2016b Text Manipulations to Fix These Addresses (Part 1)
Use R2016b Text Manipulations to Fix These Addresses (Part 2)
Use R2016b Text Manipulations to Fix These Addresses (Part 3)
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers107
Suggested Problems
-
596 Solvers
-
Arrange Vector in descending order
14177 Solvers
-
Determine the number of odd integers in a vector
862 Solvers
-
Matlab Basics - Convert a row vector to a column vector
685 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
2246 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!