How do I plot quivers on a curve?

I'm Currently trying to add a quiver plot onto a curve so it looks somewhat like the figure a with the quivers being wind direction and speed. It's my first time trying to do such a thing so some point outs would be very helpful. The data that I'm using is attached. My current code is:
rawTable = readtable('testData.xlsx','Sheet','Sheet1');
x = rawTable.time;
y = rawTable.Tides;
z = rawTable.Windspeed;
a = rawTable.Compass;
b = rawTable.Winddir;
a1 =z.*a
b1 =z.*b
plot(x,y)
hold on
quiver(x,y,a1,b1)
which I obtained from plot pressure as vectors on a curve - MATLAB Answers - MATLAB Central (mathworks.com), but when i run my code I instead get figure b.
figure a)
figure b)

답변 (1개)

KSSV
KSSV 2021년 10월 25일

0 개 추천

If you are expecting colors based on the magnitude use this: https://in.mathworks.com/matlabcentral/fileexchange/3225-quiverc

댓글 수: 1

kura mara
kura mara 2021년 10월 25일
Thanks for the input, I'll have a look at it. I updated my question, the problem that I'm having is that the code that I'm using doesn't produce the result in figure (a), and I want to know what is causing it.

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

카테고리

도움말 센터File Exchange에서 Vector Fields에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 10월 25일

댓글:

2021년 10월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by