Simulation Moving Object problem

4 次查看(过去 30 天)
engineerOfPhysics
engineerOfPhysics 2013-5-15
Hello guys !!!!!!
for ax=1:1:100
if ax<10
c=line(x6+ax,y6+ax*tan(30*pi/180));
b=line(x5+ax,y5+ax*tan(30*pi/180));
a=line(x4+ax,y4+ax*tan(30*pi/180));
pause(0.1)
delete(a,b,c)
else
ax=-ax;
c=line(x6+ax,y6+ax*tan(30*pi/180));
b=line(x5+ax,y5+ax*tan(30*pi/180));
a=line(x4+ax,y4+ax*tan(30*pi/180));
pause(0.1)
delete(a,b,c)
end
end
I need some help. I tried to moved an object I created with three lines as you see ( written above is just a part of real code). My aim is that object will move to some direction then after a condition it will be back. But when I try the code it moves firstly there is no problem then when the condition will be active I expected that object changes the direction to back but the objcet suddenly will be at the starting point then moves to the back direction.
I do not understand where is the problem.
Thanks for all body !!

回答(1 个)

engineerOfPhysics
engineerOfPhysics 2013-5-15
Hey Is there anyone to say anything ?
Where is the wrong ?? please help guys..

类别

Help CenterFile Exchange 中查找有关 App Building 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by