Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

how do i write general code using variables for my following code?

1 visualización (últimos 30 días)
kanuri venkata mohana
kanuri venkata mohana el 1 de Jun. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
% rectangle assembly
clc
close all
clear all
figure()
%% patch: Create one or more filled polygons
p1 = patch([0 0 2 2 0], [0 5 5 0 0], [0.5 0 0.5]);
p2 = patch([2 2 4 4 2], [0 5 5 0 0], [0.5 0 0.5]);
rotate(p2, [0 0 1], 120, [2 5 0])
p3 = patch([-2 -2 0 0 -2], [0 5 5 0 0], [0.5 0 0.5]);
rotate(p3, [0 0 1], -120, [0 5 0])
axis([-10 10 -5 15])
axis equal
grid on
  1 comentario
Geoff Hayes
Geoff Hayes el 1 de Jun. de 2020
kanuri - what should the general variables be? The inputs to the patch function and/or the rotate function? Once you have determined what those general variables (or inputs) should be, you will probably want to change your above code from a script to a function.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by