Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
kanuri venkata mohana
kanuri venkata mohana le 1 Juin 2020
Clôturé : MATLAB Answer Bot le 20 Août 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 commentaire
Geoff Hayes
Geoff Hayes le 1 Juin 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.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by