Counting First digit of a certain number
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I am working with a large number of data to analyze if there are any failures in data which having some hard time manually looking at the data or even with graphs. So I was wondering if there is a way to count the first digit number out of table which then I just need to look into how many failures happened. Thanks in advance...
For example,
t = [0, 0; 0, 1; 0, 1; 1, 1; 1, 0; 0, 0; 0, 1]
t2 = [1, 1; 0, 1; 0, 1; 0, 1; 1, 1; 0, 1; 1, 1]
t3 = [0, 1, 1; 1, 0, 0; 1, 1, 0; 1, 0, 1; 1, 1, 0; 0, 0, 1; 1, 1, 1]
then
T_count = [1, 2]
T2_count = [3, 1]
T3_count = [2, 4, 3]
0 件のコメント
採用された回答
Stephen23
2024 年 3 月 12 日
t1 = [0, 0; 0, 1; 0, 1; 1, 1; 1, 0; 0, 0; 0, 1];
t2 = [1, 1; 0, 1; 0, 1; 0, 1; 1, 1; 0, 1; 1, 1];
t3 = [0, 1, 1; 1, 0, 0; 1, 1, 0; 1, 0, 1; 1, 1, 0; 0, 0, 1; 1, 1, 1];
fh = @(m) sum(diff([0*m(1,:);m],1,1)>0,1);
fh(t1)
fh(t2)
fh(t3)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!