I have a 5000 *5000 sparse matrix with 4 different values. I want to visualise the nonzero elements with 4 different colors such that I can recognise the ratio of this values an
Now i can answer the first part of the question. I suppose you need to do something like
sum(histc(A, unique(A)),2)
to count the number of unique values in the matrix.
temp = histc(A, unique(A))
"is a matrix of column histogram counts." So you get the counts of all values of unique(A)
as they appear in A columns.
I'm doing stat = sum(temp,2)
to get counts of all values of unique(A)
in the whole matrix.
Then you can use the code proposed from @Dan to visualize the result.
hold all;
u=unique(A);
for i = 1:length(stat)
plot(u(i), stat(i)/max(stat), '*');
end
Please clarify what kind of relationship between the values do you mean?