translating this polygon to a new position

i am tryin to translate this polygon so the startin point is at -10 , 3. i keep getting an error code and its not working

1 comentario

darova
darova el 10 de Mzo. de 2021
Please attach the code using this button
Attach plot_polygon function

Iniciar sesión para comentar.

 Respuesta aceptada

I don't know what your plot_polygon function does, but I'd probably create a polyshape object and translate it before plotting the translated polygon.
p = polyshape([0 1 1 0], [0 0 1 1]);
plot(p, 'DisplayName', 'original')
hold on
pt = translate(p, [2 3]);
plot(pt, 'FaceColor', 'r', 'DisplayName', 'translated')
legend show location northwest

Más respuestas (0)

Categorías

Más información sobre Vehicle Dynamics Blockset en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 10 de Mzo. de 2021

Comentada:

el 30 de Mayo de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by