Fill in a data vector into a preallocated zeros matrix

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by