I can not find important function
Show older comments
hi, I found the following code of matlab in this link http://www.ideal.ece.utexas.edu/~gjun/ee379k/html/clustering/hac/page2.html
load c.txt;
P=pdist(c,'euclidean');
Z=linkage(P,'single');
T=cluster(Z,'MaxClust',2);
plot_clusters(c,T);
I tried it with my data , it is working except the last function , it is what I looked for , this function plot each cluster with different color
how can find it? please, i badly need it in my work.
thanks
7 Comments
Oleg Komarov
on 28 Aug 2012
Please, format your code: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
Oleg Komarov
on 28 Aug 2012
@huda: I posted a link because there's a much easier facility to format the code.
After 130 and more question you still don't take the effort to watch (you don't even have to read) the .gif or to read some simple guidelines.
huda nawaf
on 28 Aug 2012
Oleg Komarov
on 28 Aug 2012
Edited: Oleg Komarov
on 28 Aug 2012
@huda: I had a teacher of biology in high school who used to say "I cannot spread apologies on my bread (in the morning when having breakfast)".
In brief, this is not the first time I post the link on how to format the question or the other link on how to ask a question properly. Also, it is common sense to provide the necessary information if you expect a reasonable answer. Thus, saying "I am sorry" and still keeping to post the same way is equivalent to fool us around. Obviously, that's my point of view.
Walter Roberson
on 28 Aug 2012
huda, you have not formatted the code in this post.
Jan
on 29 Aug 2012
@huda: Thanks for your apology. Apologies are not useful here, but improving your style to ask question is. Most of all this would be an advantage for me, the forum and last but not least for yourself.
Answers (2)
Oleg Komarov
on 28 Aug 2012
0 votes
huda nawaf
on 28 Aug 2012
Edited: huda nawaf
on 28 Aug 2012
10 Comments
Oleg Komarov
on 28 Aug 2012
One question per post and how am I supposed to know since you don't provide a test suite.
The general answer is, yes you can write alternative ways to see clusters graphically, example gscatter().
Walter Roberson
on 28 Aug 2012
Alternate plotting methods were suggested to you at least a week ago, in one of the several other threads where you asked the same question.
huda nawaf
on 29 Aug 2012
huda nawaf
on 29 Aug 2012
Walter Roberson
on 29 Aug 2012
Huda, I refuse to keep trying to read your mind about what you want the output to look like!
Oleg Komarov
on 29 Aug 2012
Edited: Oleg Komarov
on 29 Aug 2012
@huda: what if I told you that you can still use gscatter()?
(You have to read the sentence having the meme in mind)
I second Walter and I will repeat myself for the n-th time, read these guidelines http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer, after that you will understand that
- One and only one question per post
- No duplicate posts
- If you can't get an answer, 99.9% of the times your question is wrong.
- Post example inputs and example output
- Use markup to format your question (especially the code)
"Olg, Gscatter creates a scatter plot of the vectors X and Y grouped by G. But I have similarity matrix with size n*n , and vector with size n show the cluster no. that each observation in similarity matrix belong to it."
So? I don't see the problem. The vector relates to each row instead of each element, repmat it, make the n by n matrix a vector and use gscatter().
huda nawaf
on 30 Aug 2012
Edited: Oleg Komarov
on 30 Aug 2012
Walter Roberson
on 30 Aug 2012
What do you want the output to look like?
Oleg Komarov
on 30 Aug 2012
As commented in your other post, with the similiarity matrix alone, all you can do is a dendrogram.
huda nawaf
on 30 Aug 2012
Edited: Walter Roberson
on 30 Aug 2012
Categories
Find more on Graphics Performance 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!