📄 tally.m
字号:
function out = tally(x);
%TALLY TALLY(X) calculates the frequencies of the distinct levels of X.
% Output is a matrix with two rows, the first containing the
% levels of X and the second the corresponding counts.
% GKS 27 Dec 1992
s=sort(x(:))';
[m n]=size(s);
i=find( [ 1 diff(s) ] > 0 );
out=[ s(i); diff([i n+1]) ];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -