Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Matrix manipulation coding with If and for loops

1 visualizzazione (ultimi 30 giorni)
Racky
Racky il 17 Lug 2015
Chiuso: MATLAB Answer Bot il 20 Ago 2021
I have a n x 2 matrix. I want to basically look at adjacent number in the column one and if the difference in the values is greater than 1, than I want to insert a blank space in the nx2 matrix.
Can anyone please help with this?
  5 Commenti
Walter Roberson
Walter Roberson il 17 Lug 2015
cell arrays. Separate them out and work with them one by one.
dpb
dpb il 17 Lug 2015
Or use accumarray with the subscript vector obtained from
ix=find(diff([0;x(:,1))>1);
to compute the statistics wanted.

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by