フィルターのクリア

Help with getting drawnow to show one point at a time

5 ビュー (過去 30 日間)
Bradley
Bradley 2024 年 4 月 2 日
コメント済み: Matt J 2024 年 4 月 2 日
Im using drawnow to animate some data, I want to show roll, pitch, and yaw data as the vehicle is moving. My script below succefully plots the telemetry data at every point, however its plotting all points at the same time instead of one at a time.Im following a different tutorial that showed me how to use plotOrientation which worked well in plotting the telemetry. However when the drawnow function is called it just plots all my points at the same time, how do I get it to plot one point at a time? Thanks!
P = 'C:/Users/keith/OneDrive/Desktop/Single Beam Bathy/SN06222/Cleaned/Cleaned';
S = dir(fullfile(P,'*.csv'));
S = natsortfiles(S);
for k= 1:numel(S)
F2 = fullfile(S(k).folder,S(k).name);
M1 = readmatrix(F2);
lat = M1(:,1);
lon = M1(:,2);
dep = M1(:,4);
yaw = M1(:,5);
pitch = M1(:,6);
roll = M1(:,7);
alt = M1(:,8);
DepS = -1.*(dep+alt);
[x,y] = ll2utm(lat, lon);
pos = [x, y, DepS];
[minLat, maxLat] = bounds(y);
[minLon, maxLon] = bounds(x);
[minDep, maxDep] = bounds(DepS);
tp = theaterPlot('Xlimit', [minLon maxLon], 'Ylimit', [minLat maxLat], 'Zlimit', [minDep maxDep]);
op = orientationPlotter(tp,'DisplayName','Orientation', 'LocalAxesLength',2);
for i = 1:numel(S)
plotOrientation(op, roll, pitch, yaw, pos)
drawnow
end
end

採用された回答

Matt J
Matt J 2024 年 4 月 2 日
編集済み: Matt J 2024 年 4 月 2 日
The loop variable i is not being used, Perhaps you meant to have,
for i = 1:numel(roll)
plotOrientation(op, roll(i), pitch(i), yaw(i), pos(i,:))
drawnow
end
  2 件のコメント
Bradley
Bradley 2024 年 4 月 2 日
Awesome, thank you, that worked! However how do I zoom in? It shows the x y and z axis according to my limits set in tp. When I change those limits I see nothing, the axes appear but I dont see any points. Is there a way to change my view to see just the point but also have the axes update with the vehicles position? Thanks again for the help!
Matt J
Matt J 2024 年 4 月 2 日
Sorry, I don't have that Toolbox.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by