How do I plot my array on Imagesc?
16 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Adam Danz
on 7 Mar 2019
Edited: Adam Danz
on 7 Mar 2019
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 Comment
Adam Danz
on 8 Mar 2019
"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.
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!