Clear Filters
Clear Filters

How is the streamline function implemented?

2 views (last 30 days)
Having already read this, I'm still not quite satisfied. I can understand Euler's method, but that doesn't quite provide an answer as to how exactly MATLAB is able to produce streamlines. Would anyone happen to know exactly how it is implemented? Thanks in advance!

Accepted Answer

Walter Roberson
Walter Roberson on 11 Dec 2023
streamlines() is implemented by calling stream2() or stream3() to figure out where the lines go. Then it just draws the lines.
You can build the vertex list ahead of time by calling stream2() or stream3() yourself, which will return a cell array of vertex information; streamlines() passed that cell array will just draw the lines.
The question then becomes how stream2() or stream3() are implemented. stream2() turns out to be implemented by calling stream3() .
stream3() starts by doing some interpolation that I do not yet understand the meaning of; then it calls the mex routine stream3c() to do the bulk of the work. The algorithm for stream3() does not appear to be documented.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!