No Arrows showing in plot When using quiver

18 vues (au cours des 30 derniers jours)
ASHISH CHAUDHARI
ASHISH CHAUDHARI le 8 Nov 2022
Modifié(e) : VBBV le 14 Nov 2022
I am unable to getting the arrows in the plot by using the quiver. Plot shows all the calculated data tip values but not showing the arrows.
Code as given below. Please help me for this problem.
[X,Y]=meshgrid(-2.5:0.1:2.5,-2.5:0.1:2.5);
Ur=(1+((Y-X)/2.5)-((X*Y)/(2.5^2)));
for i=1:size(X,1)
for j=1:size(X,2)
Uz1(i,j)=(3-(3.75/X(i,j)));
end
end
figure(1)
q=quiver(X,Y,Ur,Uz1,'ShowArrowHead','on','LineWidth',1,'MarkerSize',3);
q.Color = 'red';
q.AutoScaleFactor='1';

Réponse acceptée

VBBV
VBBV le 8 Nov 2022
Modifié(e) : VBBV le 8 Nov 2022
[X,Y]=meshgrid(linspace(-2.5,2.5,10));
Ur=1+((Y-X)/2.5)-((X.*Y)/2.5^2);
for i=1:size(X,1)
for j=1:size(X,1)
Uz1(i,j)=(3-(3.75/X(i,j)));
end
end
figure(1)
q=quiver(X,Y,Ur,Uz1,'LineWidth',1);
q.Color = 'red';
If you use autoscale factor along with arrowhead on it will distort the quiver diagram and misintrepret the plot.
  7 commentaires
VBBV
VBBV le 12 Nov 2022
Modifié(e) : VBBV le 14 Nov 2022
If it solved your problem, pls accept the answer
ASHISH CHAUDHARI
ASHISH CHAUDHARI le 14 Nov 2022
Thank you for your humble responce. It has been solved my problem with your solution.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by