Fill in a data vector into a preallocated zeros matrix

1 vue (au cours des 30 derniers jours)
Sebastian Engelsgaard
Sebastian Engelsgaard le 22 Jan 2021
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?

Réponse acceptée

James Tursa
James Tursa le 22 Jan 2021
m = reshape(v,500001,4);

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by