Le 17/04/2013 16:23, CRETE Denis a écrit :
Hello,
It probably comes from an accumulation of data in the graph: try to avoid 
re-plotting the whole vector of data.
If you don't mind about line joining points, reduce plotting to the last data 
point
plot2d(x($),y($), style=-1)  // you must use a  negative style to see 
something...

If you need the line joining points, just plot the last pair of data points
plot2d(x($-1:$),y($-1:$))

If you want to add point to a curve, it is more efficient to add them to the polyline data

example
clf;
a=gca();
a.data_bounds=[0 -1;10 1];
a.axes_visible="on";
xpoly([],[]);p=gce();
for x=0:0.1:10
   p.data=[p.data;x, sin(x)];
end

If you want a moving curve you can proceed similarily:
clf;a=gca();
a.data_bounds=[0 -1;10 1];
a.axes_visible="on";
t=(0:0.01:10)';
w=1:0.1:10;
xpoly([],[]);p=gce();
realtimeinit(0.01)
for k=1:length(w)
   realtime(k)//to slow down
   p.data=[t, sin(w(k)*t)];
end

Serge
HTH
Denis
-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De 
la part de larryonov
Envoyé : mercredi 17 avril 2013 15:52
À : [email protected]
Objet : [Scilab-users] Still running script

Hi, first of all I have to say that Scilab is great alternative to Matlab etc
:-)

And now to my problem. I want to use Scilab for plotting graph which takes 
values from a file (and file is modified during my device is measuring).

I have tried never ending while-end loop but in every step it takes longer and 
longer time measured with tic() and toc() until it will freeze permantently. It 
is not because of the file is rising, I'm trying it when the device is off and 
file is still the same.

I also tried run the script from another using exec() and then clear, but 
without result.

When I abort execution and then run script again it continues from 'bad'
execution time to worse. The only thing working is that I run Scilab again.
Like something is in the memory (not variables, with clear() it isnt better).

Do you have any better idea than me how to realize the 'still running'
script or any other suggestion. Thank you.



--
View this message in context: 
http://mailinglists.scilab.org/Still-running-script-tp4026562.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users


_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to