understanding quiver and plotting arrows with direction and speed
Show older comments
Im pretty sure I am trying to make a map using quiver. I have AUV data from a vehicle that collected current information. The data collected is lat, long, depth, current speed, and current direction, so 5 total variables. The current direction is just a degree reading, for example water passed by the vehicle at 255° relative to the front of the vehicle. What I want to do is plot the direction and intensity of water for the duration of the survey. The code I wrote is below, Im trying to use quiver for this but the result is all the vectors being the same length and in the same direction. Looking at the data I can see that that is not the case, water direction changes as well as speed of the water. Am I not understanding something about quiver, or am I plotting the data incorrectly? Any advice would be appreciated.
P = 'C:/Users/keith/OneDrive/Desktop/Single Beam Bathy/SN06222';
Q = 'C:/Users/keith/OneDrive/Desktop/Single Beam Bathy/SN06222/Corrected CSV';
S = dir(fullfile(P,'*.csv'));
S = natsortfiles(S);
N = numel(S);
C = cell(N,1);
C1 = cell(N,1);
for k= 1:numel(S)
F = fullfile(S(k).folder,S(k).name);
O = readmatrix(F);
[M, ~, ~] = rmoutliers(O,1);
lat = M(:,1);
lon = M(:,2);
dep = M(:,4);
alt = M(:,8);
currentS = M(:,24);
currentD = M(:,25);
Dep = -1*(alt+dep);
depS = smoothdata(Dep,'movmedian',500);
end
X = lon;
Y = lat;
U = currentD;
V = currentS;
quiver(X,Y,U,V,)
Heres an example of the output.

Accepted Answer
More Answers (0)
Categories
Find more on Vector Fields in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
