How do I plot my array on Imagesc?

16 次查看(过去 30 天)
Hi,
I have an array that is a 16x20x64 double which I want to represent using imagesc to show the distribution of the data across different electrodes on the scalp (the data is from an EEG signal). The X-axis of the image should be the frequency, which ranges from 0-40Hz in 2Hz bins, and the Y-axis should be the electrode number, which ranges from 1-16.
Not sure if this is helpful but this is how I reshaped the data from it's original from, so that it reflects the frequency range and the electrodes:
newarray = reshape(ec_psd_2hz,16,20,64)
So I should end up with a colour map with 320 pixels.
Any help would be amazing as I'm pretty sure the image I am getting is incorrect, I didn't really understand what was on the imagesc documentation page so it didn't really help.
  4 个评论
Emma Ponting
Emma Ponting 2019-3-7
The third dimension is the number of arrays of data I have, not a third dimension.
When I look at the raw data it is 64 matrices that are all 16x20
Emma Ponting
Emma Ponting 2019-3-7
eg.png
This is what I would get ideally

请先登录,再进行评论。

回答(2 个)

Adam Danz
Adam Danz 2019-3-7
编辑:Adam Danz 2019-3-7
The examples in Matlab's documentation should be useful to follow.
For your data, this should get you started.
x = 0: 2: 40; %hz
y = 1 : 16; %elect num
data %your matrix that is size [16, 20]
imagesc(x,y,data') % note that 'data' is transposed to size [20,16]
  1 个评论
Adam Danz
Adam Danz 2019-3-8
"When you say data do you just mean my 20x16x64 data set?"
In your comments under the question, you mentioned, "When I look at the raw data it is 64 matrices that are all 16x20". "Data" in my solution refers to one of these 16 x 20 matricies.

请先登录,再进行评论。


Emma Ponting
Emma Ponting 2019-3-8
When you say data do you just mean my 20x16x64 data set?

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by