How to display dictionary elements along with their frequency

I m trying to display the dictionary elements and their frequency on the same line.
I have got the frequency using TMG.Both can be displayed independently.
How to display them together.?????
I tried this-
dictionary(A(:,1),:)
and
disp(['dictionary = ' num2str(dictionary(:,:))])

3 Comments

What variables are involved in this matter, and what information do they hold in which order?
What is "A" ? What is "dictionary" ?
I m working on the problem of extracting features from text data.I m using TMG for generating the initial term-document-matrix,A.
Along with tdm,it generates the dictionary(a set of words from documents which are filtered on the basis of frequency of occurence;it doesnt contain stop words.)
dictionary contains names of terms and A contains the terms as numbers along with the frequency of occurence. I want to use these 2 variables to display as :
Eg:
dictionary=(a,b,c,d)
A=
(2,1)=3 (it means term 2 occurs in 1st doc 3 times)
(1,4)=5
(4,4)=5
...
...
i want to dispaly it as
1 2 3 4
a 0 0 0 5
b 3 0 0 0
c 0 0 0 0
d 0 0 0 5
I m not getting how to do it.
Please post simply some code, which creates the variables, as e.g.:
A = {'a', [0,0,0,5]; 'b', [3,0,0,0]}
or:
dictonary = {'a', 'b', 'c', 'd'};
A = [0,0,0,5; 3,0,0,0; 0,0,0,0; 0,0,0,5];
or how your data look like. Expressions like "dictionary=(a,b,c,d)" or "A=(2,1)=3" are clear to you, but as long as this is no valid Matlab syntax, we could only guess what this means exactly.

Sign in to comment.

Answers (0)

Categories

Tags

Asked:

on 29 Oct 2012

Community Treasure Hunt

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

Start Hunting!