## How Can I plot a complex matrix based on a threshold value

Asked by Rahmat Ullah

### Rahmat Ullah (view profile)

on 11 Jan 2019
Latest activity Edited by Rahmat Ullah

### Rahmat Ullah (view profile)

on 12 Jan 2019
I have a 100X100 complex double matrix, and I want to plot (surf or imagesc) by mapping values to red that are greater then a threshould (can be any value) and white if less then threshould.

Show 1 older comment
Rahmat Ullah

### Rahmat Ullah (view profile)

on 11 Jan 2019
Thanks for such a quick responce, actally I am new to matlab , I tried some solutions for both parts of my questions but didnt get what i want.
Akira Agata

### Akira Agata (view profile)

on 12 Jan 2019
Like this?
% 100x100 complex double matrix
X = rand(100,100) + 1i*rand(100,100);
% Index of some metric (e.g absolute value) > threshold (e.g 1)
idx = abs(X) > 1;
% Show the result (Red: |X| > 1, White: |X| <= 1)
imagesc(idx)
colormap([1 1 1;1 0 0])
Rahmat Ullah

### Rahmat Ullah (view profile)

on 12 Jan 2019
Thanks Akira. I'm glad it helped.