distance matrix with a linear feature
I did have the same the same research question as you. I wanted to calculate the distance from archaeological sites to rivers. I did have access to a hydrological layer by INEGI. I did have rivers as lines and as polygons. This is what I did. First I converted the polygons to lines using vector/ geometry tools/polygon to lines. Now I did have all my rivers as lines. I merged both layers using vector/data management tools / merge shapefiles to one.
Now with just one line layer I extracted the nodes of this layer with vector/ geometry tools/extract nodes. You can see the result. One piece of advice. For some reason all my nodes were extracted as multipoint, so I used vector geometry tools/ multipart to single parts to have my nodes as individual nodes (look at this Problem with Distance Matrix in Qgis 2.83).
Assigning an individual identifier is easy . Using the field calculator, you can use under variables the row_number function. This will add a consecutive ID to each node.
Now you can use the distance matrix tools as described in the link you mention. Here are my results following the same tutorial
As you can see, Is not a one step procedure, but It did work.
Hope it help you