Plotting Streamlines that start from the origin for each streamline

7 ビュー (過去 30 日間)
Omar Azami
Omar Azami 2019 年 12 月 24 日
回答済み: Pravin Jagtap 2019 年 12 月 27 日
Hello
I want to plot streamlines for the electric field of a dipole that starts from the origin for each streamline. My code is as follows
vr1 = vr(1,:)
vr2 = vr(2,:)
vr3 = vr(3,:)
vr11 = reshape(vr1,[6,6,6])
vr21 = reshape(vr2,[6,6,6])
vr31 = reshape(vr3,[6,6,6])
subplot(1,2,1)
for i = 1:size(pointst,2)
quiver3(pointst(1,i),pointst(2,i),pointst(3,i),vr(1,i),vr(2,i),vr(3,i),'color','b')
hold on
xlabel('X-axis')
ylabel('Y-axis')
zlabel('Z-axis')
plot3(0,0,0,'o','MarkerFaceColor','r')
end
hhh = streamline(X,Y,Z,vr11,vr21,vr31,0,0,0)
set(hhh,'color','red')
The result I get is a single (very short) line segment from the origin instead of a bunch of field lines. I rotated the figure to show the xy-plane. It is a 3d vector field.
Image 12-24-19 at 2.53 PM.jpg
I was hoping for something more like
(I didn't embed the picture because it was too big)
Hopefully I have given enough detail for people to help answer my question. Apologies If I have not.
Thank you for any help in Advanced.

回答 (1 件)

Pravin Jagtap
Pravin Jagtap 2019 年 12 月 27 日
Hello Omar,
I suggest you to refer this documentataion for plotting streamlines.
~Pravin

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by