Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Matrix manipulation coding with If and for loops

1 Ansicht (letzte 30 Tage)
Racky
Racky am 17 Jul. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 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 Kommentare
Walter Roberson
Walter Roberson am 17 Jul. 2015
cell arrays. Separate them out and work with them one by one.
dpb
dpb am 17 Jul. 2015
Or use accumarray with the subscript vector obtained from
ix=find(diff([0;x(:,1))>1);
to compute the statistics wanted.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by