Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Matrix manipulation coding with If and for loops

조회 수: 1 (최근 30일)
Racky
Racky 2015년 7월 17일
마감: MATLAB Answer Bot 2021년 8월 20일
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
Walter Roberson
Walter Roberson 2015년 7월 17일
cell arrays. Separate them out and work with them one by one.
dpb
dpb 2015년 7월 17일
Or use accumarray with the subscript vector obtained from
ix=find(diff([0;x(:,1))>1);
to compute the statistics wanted.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by