Matlab GUI. How can i make an animated dot in a parabola in a 1 by 1 plane?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ariel Goya
am 4 Apr. 2019
Kommentiert: Andreas Bernatzky
am 4 Apr. 2019
Hi everyone, I need help to do an animated dot. but instead of a straight line, i need to do it in a parabola in a 1 by 1 plane. How can I code this?
3 Kommentare
Image Analyst
am 4 Apr. 2019
Not sure what a 1 by 1 plane, but did you try plotting with just . instead of -?
Instead of
plot(x, y, 'b-');
try
plot(x, y, 'b.', 'MarkerSize', 18);
Akzeptierte Antwort
Andreas Bernatzky
am 4 Apr. 2019
Hey Ariel,
with a 1by1 plane you mean a simple xy plane?
Here a rough example. You should consider the command draw now.
x=-10:0.1:10;
y=x.^2+x+1;
for(xmom=x(1):0.1:10)
plot(x,y);
hold on
ymom=xmom.^2+xmom+1;
plot(xmom,ymom,'-o');
pause(0.1);
clf;
end
2 Kommentare
Andreas Bernatzky
am 4 Apr. 2019
Transparency should be easy: https://de.mathworks.com/help/matlab/ref/alpha.html
Ploting an image with variable position I am not really familiar with this. I just used
https://de.mathworks.com/help/images/ref/imshow.html once and it worked for me. But my application had not a moving image. But I think you should be able to manipulate the image position by the Position handle of an object in a figure. Thats what I would try first.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Lighting, Transparency, and Shading 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!