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 Center および File ExchangeSparse Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by