How do I plot quivers on a curve?
Mostrar comentarios más antiguos
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)

Respuestas (1)
KSSV
el 25 de Oct. de 2021
0 votos
If you are expecting colors based on the magnitude use this: https://in.mathworks.com/matlabcentral/fileexchange/3225-quiverc
1 comentario
kura mara
el 25 de Oct. de 2021
Categorías
Más información sobre Vector Fields en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!