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)
Mostrar comentarios más antiguos
% 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
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.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!