필터 지우기
필터 지우기

How is streamline function is implemented in MATLAB?!

조회 수: 15 (최근 30일)
Nick Earnhardt
Nick Earnhardt 2015년 5월 28일
댓글: Nick Earnhardt 2015년 5월 29일
Hello everyone,
I post a question some times ago, I am still searching about it. I found a function that does exactly what I want! However it is a MATLAB built in function and I need to know how it works?! It draws curved lines in th direction of the gradient! I want to do the same.
I have an image, I want to take it's gradient and draw the same lines for the gradient vectors! Just like the following image.
This produces an amazing result for my problem. How these lines are generated? I need the data points of these lines not only just drawing them!
Anyone has any clue how the lines are derived?! Or how can I do the same?!
Any idea how streamline finds these curved smooth lines?
Thanks a lot.
  댓글 수: 1
Nick Earnhardt
Nick Earnhardt 2015년 5월 29일
Dear Joseph,
Thanks a lot for your help, as you said the Euler Integration aka Forward Euler Prediction, is the solution.
And my problem is already solved! It wasn't hard to implement it at all!
Thanks a lot for your help.

댓글을 달려면 로그인하십시오.

채택된 답변

Joseph Cheng
Joseph Cheng 2015년 5월 28일
Well how to generate the lines will take a bit of thought but to get the lines
[x,y] = meshgrid(0:0.1:1,0:0.1:1);
u = x;
v = -y;
figure
quiver(x,y,u,v)
startx = 0.1:0.1:1;
starty = ones(size(startx));
hstream = streamline(x,y,u,v,startx,starty);
Xdata = get(hstream,'Xdata');
Ydata = get(hstream,'Ydata');
hold on
for ind =1:length(Xdata);
plot(Xdata{ind},Ydata{ind},'r--')
end
  댓글 수: 6
Joseph Cheng
Joseph Cheng 2015년 5월 28일
Well from what i gather the streamline() function is performing something along the lines of Euler Integration or Runge-Kutta to some order. performing a very quick google search
has a lecture on it (see slide 22+)
Nick Earnhardt
Nick Earnhardt 2015년 5월 29일
Dear Joseph,
Thanks for the clue.
I downloaded the PDF now, I'll have a look today.
Thanks a lot.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by