how to quickly decompressed a matrix

1 回表示 (過去 30 日間)
Sam
Sam 2017 年 2 月 15 日
コメント済み: Sam 2017 年 2 月 15 日
I have compressed matrix a, first row is index and second row is value, how can i convert it to full matrix b of 2x10 elements below?
a = [1 5 8;
0.2 0.6 -1.1];
b = [1 2 3 4 5 6 7 8 9 10;
0.2 0.2 0.2 0.2 0.6 0.6 0.6 -1.1 -1.1 -1.1];

採用された回答

Walter Roberson
Walter Roberson 2017 年 2 月 15 日
repelem using diff() of the indices as the counts
  1 件のコメント
Sam
Sam 2017 年 2 月 15 日
Thanks Walter

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by