MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by sp
on 5 Dec 2012

A = [126126,138154,137146]

Output i want is A = [126,126,138,154,137,146]

*No products are associated with this question.*

Answer by Jos (10584)
on 5 Dec 2012

Edited by Jos (10584)
on 5 Dec 2012

Accepted answer

help rem

help floor

A = [126126, 138154,137146] B = [floor(A/1000) ; rem(A,1000)] B = B(:).' % for cosmetic purposes only

Answer by Azzi Abdelmalek
on 5 Dec 2012

Edited by Azzi Abdelmalek
on 5 Dec 2012

out=str2num(reshape(num2str(A')',3,[])')'

## 2 Comments

## José-Luis (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/55763#comment_115453

Praveen, please accept answers if they help you. I have looked at your question history and you never seem to do that.

## sp (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/55763#comment_115544

hey i do accept...whn i find right answers... thank you