How to access column of double in struct array?
Show older comments
Hi good people!
I have a shp file (coastlines.shp) and need to get the lat, long and date data that are in the x, y and date (multiple data points) columns in double format and turn them into matrix data. Every time I try to access, I can only get the data from the first line or specific line, I've tried several ways, but without success.
Could be help me?

3 Comments
The MATLAB approach would be to use comma-separated lists:
But note that all of the X and Y vectors have different lengths: so far your indexing shows that you have not taken this into account. Before you start trying to join them all together, you need to decide how you want to concatenate vectors of different sizes together.
"How to access column of double in struct array?"
None of X and Y are columns vectors, so it seems there might be some confusion about sizes.
Cícero Vicente
on 10 Jun 2023
Accepted Answer
More Answers (1)
x(i,:) = y(i,:) = Date(i,:) = % rename date in output vector to Date as its already used in the struct
Use the above format as shown which uses the for loop index.
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!