필터 지우기
필터 지우기

Hello everyone, help for consolidation of numbers

조회 수: 1 (최근 30일)
SAVAS PAPAGIANNIDIS
SAVAS PAPAGIANNIDIS 2019년 3월 11일
댓글: SAVAS PAPAGIANNIDIS 2019년 3월 12일
Hello everyone,
I would like your help in the following :
How can i convert A = [1,2,3,4,5,6......n] to B = [123,456,......n],........ ???
thanks in advance..!!

채택된 답변

Bob Thompson
Bob Thompson 2019년 3월 12일
One convoluted way of doing this would be to convert to strings and back.
for i = 1:length(A)/3
B(i) = str2num([num2str(A(3*i-2)),num2str(A(3*i-1)),num2str(A(3*i))]);
end
  댓글 수: 1
SAVAS PAPAGIANNIDIS
SAVAS PAPAGIANNIDIS 2019년 3월 12일
It's exactly what I wanted, thank you for your gracius response. . ! ! !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by