ある行の任意値の数を数えるコードを作りたい
Mostrar comentarios más antiguos
ある行の任意の値の数を求めるコードをfor文なしで作成したいのですがどういうアルゴリズムにすればよいか悩んでいます.
例えば,
A=[1,1,2,3;1,1,1,2];
A行列に対して,1行目は’1’が2個,2行目は'1'が3個なので
ans=[2;3]というように出したいです.
お手数ですが,ご教授いただきたいです.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre プログラミング en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!