How to generate joint frequency table?
古いコメントを表示
Dear experts,
I have two vectors and I want to make a joint frequency table, I tried tabulate but failed, I was wondering what is wrong with my code, and if there is any other code can help me do this?
Many thanks!
Below is the code I tried:
% Two vectors
Attribute
Assignment_result
% Combine them together
data=table(Attribute,Assignment_result)
% Tabulate
joint_freq=tabulate(data.Attribute,data.Assignment_result)
disp(joint_freq)
But matlab suggests 'too many input arguments'
3 件のコメント
Jon
2023 年 4 月 12 日
The tabulate function just provides frequencies for one variable, it ony accepts one vector as an argument. This is why you get the error "too many input arguments". Please provide the data that you wish to find the joint frequency of for further guidance.
Dyuman Joshi
2023 年 4 月 12 日
tabulate() accepts only 1 input, whereas you are giving 2 inputs to it.
What are you trying to do? Calculating the frequency of 1 vector w.r.t to other?
In any case, please attach your data (use the paperclip icon to do so), and mention the output you want to obtain.
Rouyu Chen
2023 年 4 月 12 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Foundation and Custom Domains についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
