How do I plot my array on Imagesc?
14 ビュー (過去 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 件のコメント
回答 (2 件)
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
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.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
