How can i create a group from some lines and some arrows?

2 Ansichten (letzte 30 Tage)
Le Dung
Le Dung am 18 Nov. 2017
Bearbeitet: Le Dung am 18 Nov. 2017

Hi everyone! I have a code (see below) that will create two black lines and three arrows. So, How can i create a group from some lines and some arrows ? I tried use findobj, hggroup, but i couldn't do it. My code:

clear
clc
% THONG SO BAN DAU CUA BAI TOAN
Ltt=23; % m
V_kmh=30; % (km/h)
deltat=0.001; % (s) % So gia thoi gian
V_ms=V_kmh*1000/3600; % (m/s)
ttotal=Ltt/V_ms; % (s)
tstep=round(ttotal/deltat);
% Tao cac truc do thi
subplot(2,1,1);
axis([-9 25 -0.05 0.1]);
hold
% VE CAC GOI CUA DAN GIAN DON
% Ve goi co dinh
plot([-0.5 0.5 0],[-0.02 -0.02 0],'ro')
line([-0.5 0.5],[-0.02 -0.02])
line([-0.5 0],[-0.02 0])
line([0.5 0],[-0.02 0])
% Ve goi di dong
plot([23 23],[-0.02 0],'ro')
line([23 23],[-0.02 0])
% VE DAM CHU
line([0 23],[0 0])
% TAO RA CAC MUI TEN TAI TRONG CHAY TREN DAM CHU
higharrow=0.04;
Ljump=Ltt/tstep;
% CHO TAI TRONG CHAY QUA CAU
% Xep xe 3 truc len dau cau
arr1=arrow([0 higharrow],[0 0],13,'EdgeColor','r','FaceColor','g'); % Truc thu 1
arr2=arrow([-4.3 higharrow],[-4.3 0],13,'EdgeColor','r','FaceColor','g'); % Truc thu 2
arr3=arrow([-8.6 higharrow],[-8.6 0],13,'EdgeColor','r','FaceColor','g'); % Truc thu 3
line1=line([-8.6 -4.3],[higharrow higharrow],'Color','k');
line2=line([-4.3 0],[higharrow higharrow],'Color','k');

Antworten (0)

Kategorien

Mehr zu Particle & Nuclear Physics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by