Convert Two Arrays into One Matrix Containing Incremented Between Values

Let's say I have:
i and I, such that I=i-10
i =
100
432
660
I =
90
422
650
And want Matlab to produce the following matrix:
90 91 92 93 94 95 96 97 98 99 100
422 423 424 425 426 427 428 429 430 431 432
650 651 652 653 654 655 656 657 658 659 660
How would I go about doing that? It seems like it should be pretty simple...

 採用された回答

David Young
David Young 2011 年 4 月 4 日

0 投票

bsxfun(@plus, I, 0:i(1)-I(1))

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Data Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by