How to plot standard dev. from a closed-loop trajectory
이전 댓글 표시
Hello, I am trying to plott the standard deviation of the X and Y points of a trajectory (T) obtained as a mean of different trajectories. So far I have tried the the easy-way-out that was adding and subtracting the sd to the mean of T and plotting those:
T = plot(x, mean_y, 'Color', 'k', 'LineWidth', 2);
sd = plot(x, [mean_y - 2*std_y; mean_y + 2*std_y], 'Color', 'r');
However, this doesn't work when you have a closed loop.
My second idea was to get the tangent of each point in my plot through the differential of my plot, and obtain each point on the tangent of this derivetive at a distance of sd. However I am not 100% sure of how to implement this. So far I have:
der_x = diff(R_avg_z)./diff(R_avg_x) %tangent of the curve
I would trully appreciate some help with this as this is not my field of expertiese.
Thank you
Alonso
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

