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 commentaire

darova
darova le 10 Mar 2021
Please attach the code using this button
Attach plot_polygon function

Connectez-vous pour commenter.

 Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Vehicle Dynamics Blockset dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by