Info
この質問は閉じられています。 編集または回答するには再度開いてください。
how do i write general code using variables for my following code?
1 回表示 (過去 30 日間)
古いコメントを表示
% 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 件のコメント
Geoff Hayes
2020 年 6 月 1 日
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.
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!