How to move quiver arrows within the semi-circle
3 次查看(过去 30 天)
显示 更早的评论
x=0:0.01:1;
y=0:0.01:1;
x=x.^2
y=-x.*y
c=10
quiver(x(1:c:end),y(1:c:end))
hold on
y=-x+1
plot(x,y)
y=sqrt(1-x.^2)
plot(x,y)
xlim([0 12])
ylim([0 1])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/966630/image.png)
This code gave me this plot.
However, I want to obtain a plot something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/966635/image.jpeg)
Sorry for the bad explanation.
Is it possible to move the quiver arrows to fit in the semi-circle equation?
0 个评论
采纳的回答
Voss
2022-4-16
It's not clear how you determine where the quivers start, i.e., where the 'base' of each one (not the arrow end - the other end) belongs, so here they all start along the line y = 1:
x=0:0.01:1;
y=sqrt(1-x.^2);
c=10;
xq = x(1:c:end); % an arrow at each x
nq = numel(xq);
yq = ones(1,nq); % all starting along the line y = 1
uq = zeros(1,nq); % pointing straight down: u = zero (no x-component)
vq = y(1:c:end)-1; % v = y-1 (from the line y = 1 to the curve y = sqrt(1-x^2))
quiver(xq,yq,uq,vq,'AutoScale','off')
hold on
plot(x,1-x)
plot(x,y)
2 个评论
Voss
2022-4-16
Here are some inclined arrows starting at y=1:
x=0:0.01:1;
y=sqrt(1-x.^2);
c=10;
xq = x(1+c:c:end);
nq = numel(xq);
yq = ones(1,nq);
uq = x(1:c:end-c)-xq;
vq = y(1:c:end-c)-1;
quiver(xq,yq,uq,vq,'AutoScale','off')
hold on
plot(x,1-x)
plot(x,y)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!