Returning matrix value back from Single-Indexing-colon matrix

2 ビュー (過去 30 日間)
KaMu
KaMu 2013 年 11 月 27 日
コメント済み: KaMu 2013 年 11 月 27 日
If I have a matrix 3X5: A =
1 2 3 4 5
4 3 2 1 5
7 5 3 2 5
and I want to convert it into single-indx matrix
d=A(:)
d =
1
4
7
2
3
5
3
2
3
4
1
2
5
5
5
Q: is there a simple way to return the matrix 'A' again from 'd' to its original 3X5 again? Why I am doing that? because using this way in my code, I am saving lots of time of calculations.

採用された回答

Walter Roberson
Walter Roberson 2013 年 11 月 27 日
reshape(d, 3, 5)
  1 件のコメント
KaMu
KaMu 2013 年 11 月 27 日
Thank you, u solved my whol-day-problem!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by