Creating animation of signals from vectors of different points.

Hi. I'm very ew with MATLAB and currently using it for my research. Currently I'm able to get raw data of piezoeletric signals using handyscope and filter it. I'm trying to plot an animation (e.g: a colormap/meshgrid) of the propogation of the wave signals on a 5x5 grid points generated at a fixed time lapse.
The problem is I don't know how to assign each of my data collected for each point to a 5x5 grid in the MATLAB and how to compile it and make it into an animation.
Some sort of example I'm trying to get is as below:
or
Both of the examples above i presumed to come with an equation for the data acquired. I am currently stuck with raw vector datas to be plotted. Some of the idea I'm able to come up with is collecting all the data from each point into a single matrix and assign it onto each grid point. But I don't know how. Any ideas?

Answers (1)

you can use drawnow and pause(0.1) in a loop.
For example:
x = 1:20;
y = 1:20;
[X, Y] = meshgrid(x,y);
for j = 1:10
surf(X,Y,rand(20));
axis([1 20 1 20 0 1]);
drawnow;
pause(0.1);
end

4 Comments

yes this works. now a new problem arise. for the 'rand(20)', let saw i have specific value for each rows, e.g:
A=row1(i,:);
B=row2(i,:);
C=row3(i,:);
D=row4(i,:);
E=row5(i,:);
F=[A;B;C;D;E];
surf(X,Y,F);
this would be simple if i have a small number of datas. but if i were to have more than 10 rows of datas to be specified, it's not going to be practical to defined each of it one by one.
is there a way to define my data in a loop?
what is 'i' here. And how are you getting row1 etc?
sorry. the row 1-5 is my data imported into matlab. and i'm iterating the data for each row one by one in a for loop to make a wave animation based on the different value of data at different time.
if its only 5 or 10 rows, its simpler to just write it down instead of trying to automatize it.
Btw, is you animation working?

Sign in to comment.

Categories

Asked:

on 31 Jan 2014

Commented:

on 3 Feb 2014

Community Treasure Hunt

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

Start Hunting!