Clearing plotCoverageArea plot in each loop while keeping a previous birdsEyePlot in the figure
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Haroon
am 17 Nov. 2017
Kommentiert: Haroon
am 21 Nov. 2017
I have code in which birdsEyePlot is supposed to be the boundary/background for my sensor plot.
I have incoming continuous ( while loop) sensor data which is plotted with plotCoverageArea.
When I use cla, it clears both birdsEyePlot and plotCoverageArea. When I don't use it, the plotCoverageArea overlaps the others and I cannot see data properly.
How can I keep birdsEyePlot in the figure window intact as background, while plotCoverageArea plot to be cleared and plotted again (or updated) in each loop.
The file is attached, I hope someone has answer.
0 Kommentare
Akzeptierte Antwort
Greg Dionne
am 17 Nov. 2017
Bearbeitet: Greg Dionne
am 17 Nov. 2017
Hi Haroon,
Don't create a new plotter every time in the loop. Just use plotCoverageArea() inside the loop for the coverage area plotter you defined outside the loop.
Something like:
% create a new bird's-eye plot
bep = birdsEyePlot( ... )
% create coverage area plotters and legend entries for left1, left2, and left3.
capLeft1 = coverageAreaPlotter(bep, 'DisplayName', 'DetectLeft1')
capLeft2 = coverageAreaPlotter(bep, 'DisplayName', 'DetectLeft2')
capLeft3 = coverageAreaPlotter(bep, 'DisplayName', 'DetectLeft3')
while < do something >
% update the coverage area for capLeft1
plotCoverageArea(capLeft1, ...)
% update the coverage area for capLeft2
plotCoverageArea(capLeft2, ...)
% update the coverage area for capLeft3
plotCoverageArea(capLeft3, ...)
end
Hope this helps!
-Greg
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Scenario Authoring finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!