In matlab, a series of plotting can be recorded as a movie. Use a frame array to store the frames, then play them back either in Matlab or save to a AVI file.
I made one for the waveforms. However, the AVI file is a bit oversized, due to the lackness of effienent compressor.
Sample code is listed as following:
clear; clf;
load max_flx_0;
extensor=max_flx_0(:,5);
flexor=max_flx_0(:,4);
torque=max_flx_0(:,3);
moviefile=avifile('coac2.avi','compression','None');
segmentsize=10;
for j=1:(2500/segmentsize);
hold on;
subplot(3,1,1); plot(extensor(1:j*segmentsize),'g');
axis([0 3000 -5 5]);
hold on;
subplot(3,1,2); plot(flexor(1:j*segmentsize),'g');
axis([0 3000 -5 5]);
hold on;
subplot(3,1,3); plot(torque(1:j*segmentsize),'g');
axis([0 3000 -2 2]);
moviefile=addframe(moviefile, getframe(gcf));
end
moviefile=close(moviefile);
[edited on 05/11/05]
I found a very good AVI compressor: it compressed my 300M avi file to 1.3M mpg, cool!
Friday, April 29, 2005
Sunday, April 24, 2005
[t] TMote: working with matlab
There are nice documentation for tiny-os. How to use Matlab to interact with TMote is mentioned in one of the sections. Briefly: 1) Several tmote measure signals and transfer them through radio link. 2) A base tmote connected to PC get the radio signal, unpack the data, and send it to UART(USB). 3) User can read raw data directly from UART(USB) , or, use SerialForwarder to forward the raw data to a local network port. 4). The java application: osilloscope can plot signals (it supports multi-sensor or multi-channel!). 5) Matlab can call java directly. With the help of JavaMatlabControl class, java can also call Matlab.
the second son
Well, another "hello world" for a newborn blog. This one is used as a working log and readings notebook.
I have long been thinking about recording daily work progress and paper reading notes, but never put into action -- I am just too lazy. A Ph.D. student need to be big in work and ideas, as well as writing. Furnishing my third paper, enjoying the sunshine of spring, it is high time to do something for long-lagged plans.
Here are the naming conventions for this blog:
[R]eading: notes of literature I read.
[T]echnical: tech skills, tips and tricks.
[S]ummary: conference summaries.
[M]iscillaneous: misc stuff.
I have long been thinking about recording daily work progress and paper reading notes, but never put into action -- I am just too lazy. A Ph.D. student need to be big in work and ideas, as well as writing. Furnishing my third paper, enjoying the sunshine of spring, it is high time to do something for long-lagged plans.
Here are the naming conventions for this blog:
[R]eading: notes of literature I read.
[T]echnical: tech skills, tips and tricks.
[S]ummary: conference summaries.
[M]iscillaneous: misc stuff.
Subscribe to:
Posts (Atom)