How to visualize the matrix with colored entries

조회 수: 86 (최근 30일)
Anastasiya
Anastasiya 2013년 6월 17일
Dear all, I have a matrix with some suspicious entries. I would like to show all entries (all numbers) and color by red my suspicious data. I have no idea how to do it:( Thanks!
  댓글 수: 2
Evan
Evan 2013년 6월 17일
편집: Evan 2013년 6월 17일
Do you mean you want to visualize the data graphically and color certain datapoints red, or are you saying you'd like certain elements to be red when you call the matrix from the command window?
Anastasiya
Anastasiya 2013년 6월 17일
Thanks, Evan. I guess I would like to color certain data points by red, but having all the values.

댓글을 달려면 로그인하십시오.

답변 (1개)

Kye Taylor
Kye Taylor 2013년 6월 17일
편집: Kye Taylor 2013년 6월 17일
What are the features that make your data suspicious? For example, if the suspicious data is all very large (say 2 standard deviations larger than the average datum), then you could try something like
% a proxy for your matrix
dataMatrix = randn(100,100);
% logical variable
isSuspect = dataMatrix > mean(dataMatrix(:))+2*std(dataMatrix(:));
% create an image where each pixel represents an entry in dataMatrix.
% the pixel will be red if isSuspect(i,j) is true
figure
imagesc(isSuspect.*dataMatrix)
% or (less exciting)
figure
imagesc(isSuspect)
  댓글 수: 2
Anastasiya
Anastasiya 2013년 6월 17일
편집: Anastasiya 2013년 6월 17일
Thanks Kye! Yes, I can do imagesc, but I also would like to see real values of entries (a table or so). And I have my own functions to identify suspicious data(outliers)...
Fatemeh Sadeghihassanabadi
Fatemeh Sadeghihassanabadi 2021년 5월 4일
you can also try heatmap function:
https://www.mathworks.com/help/matlab/ref/heatmap.html

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by