Fill in a data vector into a preallocated zeros matrix

2 ビュー (過去 30 日間)
Sebastian Engelsgaard
Sebastian Engelsgaard 2021 年 1 月 22 日
回答済み: James Tursa 2021 年 1 月 22 日
Hi,
I have a vector (called v) of size
[2000004×1 double]
with data, and I want to split this into a preallocated 500001x4 matrix (called m). The data needs to be extracted cronologically meaning that v(1,1) = m(1,1) and v(500002,1)=m(1,2)
Can anyone help?

採用された回答

James Tursa
James Tursa 2021 年 1 月 22 日
m = reshape(v,500001,4);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by