連続する要素の抽出方法
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
列データ内の2個以上5個未満の値(のグループ)を置換or消去するにはどうすればいいでしょうか?
例えば、下のようなデータがあった場合、
x = [0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1]
%出力したい結果
>> x = [0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1]
出力したい結果のように最初の 1,1 のグループのみ置換する良い方法はないでしょうか?
よろしくお願いします。
1 comentario
Akira Agata
el 6 de Ag. de 2020
連続する個数が2個以上5個未満の "1" を "0" に置換したいということでしょうか?(左端の "0" は2個連続していますが、これはそのまま残して良いでしょうか?)
Respuestas (0)
Ver también
Categorías
Más información sobre ライブラリの開発 en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!