how can i draw rectangle with line command?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
ismail uzun
il 27 Feb 2016
Commentato: ismail uzun
il 28 Feb 2016
how can i draw rectangle with line command?
and i wanna it moves
please help
0 Commenti
Risposta accettata
Walter Roberson
il 27 Feb 2016
high = 42; %example
wide = 65; %example
x0 = 0;
y0 = 0;
maxx = 500;
yamp = 300;
pos = [x0 y0 wide high];
r = rectangle('Position', pos);
xlim([0 x0+maxx+wide]);
ylim([0 y0+yamp+high]);
axis equal
hold on;
for K = 0 : 5 : maxx
x = x0 + K;
y = abs(yamp * sin(x));
pos = [x y wide high];
set(r, 'Position', pos);
pause(0.1)
end
4 Commenti
Walter Roberson
il 27 Feb 2016
The moving is the easy part. Whether you can do it with xor depends upon which MATLAB version you are using. Drawing with xor was dropped as of R2014b.
Is it possible that your actual situation involves an image that your rectangle is to appear to move over, and you have been instructed to use xor in your implementation of that?
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Dates and Time in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!