How to plot standard dev. from a closed-loop trajectory
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Line Plots 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!

