필터 지우기
필터 지우기

Split array values into 2 elements

조회 수: 3 (최근 30일)
sp
sp 2012년 12월 5일
A = [126126,138154,137146]
Output i want is A = [126,126,138,154,137,146]
  댓글 수: 2
José-Luis
José-Luis 2012년 12월 5일
Praveen, please accept answers if they help you. I have looked at your question history and you never seem to do that.
sp
sp 2012년 12월 5일
편집: sp 2012년 12월 5일
hey i do accept...whn i find right answers... thank you

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

채택된 답변

Jos (10584)
Jos (10584) 2012년 12월 5일
편집: Jos (10584) 2012년 12월 5일
help rem
help floor
A = [126126, 138154,137146]
B = [floor(A/1000) ; rem(A,1000)]
B = B(:).' % for cosmetic purposes only
  댓글 수: 1
sp
sp 2012년 12월 5일
its working.... thank you

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

추가 답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 5일
편집: Azzi Abdelmalek 2012년 12월 5일
out=str2num(reshape(num2str(A')',3,[])')'
  댓글 수: 1
sp
sp 2012년 12월 5일
thank you... its working

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


Steve
Steve 2012년 12월 5일
The function you want is reshape:
A = reshape(A, 1, [])
This gives you the output you want (A = [126,126,138,154,137,146])

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by