For Programmers: Free Programming Magazines  


Home > Archive > Matlab > April 2005 > Re: Flashing in Animation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Flashing in Animation
Vincent Y.

2005-04-23, 3:59 pm

Thank you Jiro, it really works!

But one more question!

I don't want the black horizontal line (the x axis).
I set axis off but the line still there.

Any suggestion??

Vincent
Jiro Doke

2005-04-23, 3:59 pm

Vincent Y. wrote:
>
>
> Thank you Jiro, it really works!
>
> But one more question!
>
> I don't want the black horizontal line (the x axis).
> I set axis off but the line still there.
>
> Any suggestion??
>
> Vincent


Vincent,
That's because you have 2 patches that includes a boundary on the
x-axis. You can set the edge color to red:

set(h,'edgecolor','r');

OR get rid of the x-axis boundary and use one big patch with the top
and bottom sinusoidal boundaries:

----------------------
close all, clear all;
w1=2*pi;
b1=0.2;
t=0;
x=-8*pi:16*pi/8000:8*pi;
f1=cos(w1*t)*cos(w1*t-b1*x)+2.0;
f2=cos(w1*t)*cos(w1*t-b1*x+pi)-2.0;
xx=[x x(end:-1:1)];
ff=[f1 f2(end:-1:1)];
fig=figure;
set(fig,'DoubleBuffer','on');
h=fill(xx,ff,'r');
%axis([0 14 -4.5 4.5])
while 1
drawnow
t=t+2*pi/200;
f1=cos(w1*t)*cos(w1*t-b1*x)+2.0;
f2=cos(w1*t)*cos(w1*t-b1*x+pi)-2.0;
ff=[f1 f2(end:-1:1)];
set(h,'YData',ff);
end
----------------------

jiro
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com