Visualisation of multichannel time series data

I have XxY sensor channels arranged in a matrix of X and Y dimension each recording time series data. As an output I have XxYxN matrix where X and Y are the spacial indices of the sensors and N in the time indices. How do I visualise this data while retaining the spatial indices of the channels.
I was using surf function over (XxY) matrix with a for loop over N to make a video;
But I want to visualise all the time series data across all channels i.e; the entire XxYxN matrix in a single image;
How can I do that?
Just for reference, the size of my matrix is 30X40X500

 Accepted Answer

Would something like this work?
time = 1:.1:50; % 500 data point
signal = cos(time);
for ii = 1:30
for jj = 1:40
plot3(ii*ones(size(signal)),1:length(signal),jj+signal)
hold on
end
end
If you have on large matrix (30x40x500) called m, you may code it as such:
for ii = 1:size(m,1)%or ii = m(:,1,1)
for jj = 1:size(m,2)%or jj = m(1,:,1)
plot3(ii*ones(length(m)),1:length(m),jj+m(ii,jj,:))
hold on
end
end

7 Comments

Hello Kevin; Thank you so much for your answer.
But, when I am trying to run the second code with m being my matrix - I am running into the following error -
" Error using plot3
Data cannot have more than 2 dimensions."
Can you please help to resolve this issue?
Also is there any way to visualise the sensor outputs (matrix values) in colormap format? Where the amplitudes will correspond to colors;
I was using imagesc to visualise each page of the matrix, but i need to visualise the entire matrix in the same image;
Thanks alot for your help
figure
m =rand(30,40,50);
for ii = 1:size(m,1)%or ii = m(:,1,1)
for jj = 1:size(m,2)%or jj = m(1,:,1)
plot3(ii*ones(1,length(m)),1:length(m),squeeze(jj+m(ii,jj,:)))
hold on
end
end
Also is there any way to visualise the sensor outputs (matrix values) in colormap format?
We could use scatter3 and color the markers different colors based on the amplitude.
As for using imagesc to visualise each page of the matrix, you could display multiple image slices and adjust the FaceAlpha value to make them transparent and create a stack of images.
Thanks a lot for fixing the issue;
Also, can you please suggest some other ways to visualise 3d matrix data? Considering a dimension of 30x40x500.
Here is an example of using scatter3 and setting the color of the datapoints based on the signal's ampiltude.
time = 0.1:.1:50; % 500 data points
signal = cos(time);
% preallocate
m = zeros(30,40,500);
% create m
for ii = 1:size(m,1)
for jj = 1:size(m,2)
m(ii,jj,:) = signal;
end
end
m_coord = [];
c_data = [];
for ii = 1:size(m,1)
for jj = 1:size(m,2)
m_coord = [m_coord [ii*ones(1,length(m));1:length(m);squeeze(jj+m(ii,jj,:))']];
c_data = [c_data squeeze(m(ii,jj,:))'];
end
end
m_coord = m_coord';
c_data = c_data';
figure
scatter3(m_coord(:,1),m_coord(:,2),m_coord(:,3),'.','CData',c_data)
Now, let's use slice to display a stack images of the matrix m and make the slices transparent by changing the FaceAlpha value.
figure
s = slice(m,[],[],1:size(m,3));
for ii = 1:size(m,3)
s(ii).EdgeColor = 'none';
s(ii).FaceAlpha = 0.25;
end
figure
s = slice(m,[],1:size(m,2),[]);
for ii = 1:size(m,2)
s(ii).EdgeColor = 'none';
s(ii).FaceAlpha = 0.25;
end
figure
s = slice(m,1:size(m,1),[],[]);
for ii = 1:size(m,1)
s(ii).EdgeColor = 'none';
s(ii).FaceAlpha = 0.25;
end
You could also do an animation (video) of imagesc (or surf) over time.
Thanks a lot, this works fine;
But I think in my case, for detecting the spatial and temporal location of events, this kind of display is not efficient;
Making an animation will be useful;
Thanks alot for all your help;
Also can you please suggest how can I employ "isosurface" to visualise my matrix?
My matrix is having values in the [-0.1 - +0.1].

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!