# MATLAB : table & contingency table

#### Cynderella

##### New Member
I have the following data :

Code:
data=[1 3 5 1;2 3 2 3;3 3 5 1;4 4 5 1;5 3 2 1;6 4 2 3;7 3 5 1;8 4 5 1;9 3 4 1;10 4 2 1];
Now i have to
make a table of column 2 and 3 separately.I am not clear what it is asking for.
Do i need to compute the frequency table like the following?

Code:
question1=data(:,2);
question2=data(:,3);
tabulate(question1)
tabulate(question2)
Also i have to compute contingency table of column 2 and 3. By using crosstab(), i am not understanding the resulting output.

Code:
crosstab(question1,question2)
How can i compute contingency table? Is crosstab right command ?