Skip to content

How can I export a stream network to Excel? #29

Answered by wschwanghart
wschwanghart asked this question in Q&A
Discussion options

You must be logged in to vote

Well, first of all, please reconsider why you want to have the data in Excel. Ok, you might be more familiar with Excel and its possibilities such as curve fitting, but please note that these are functionalities that MATLAB performs much better.
Still, if you really want to do it, here's how provided that you have a DEM and a STREAMobj S.

t = table;
[t.x,t.y,t.z,t.d] = STREAMobj2XY(S,DEM,S.distance);
writetable(t,'yourexcelfile.xlsx')

If your network consists of several rivers then t will contain rows with nans (so-called nan-punctuated vectors) to separate the river network into individual reaches.
In addition to the x and y coordinates of the network, the above code adds elevations and…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wschwanghart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant