MATLAB Answers

Split a column data into multiple columns

63 views (last 30 days)
Abdul Ghaffar
Abdul Ghaffar on 4 Jun 2019
Commented: Walter Roberson on 21 Oct 2019
I have 1000 observations in a column.
I want to convert first 5 element in 1st row
next 5 element in 2nd row and
next 5 in 3rd row and so on....
Please someone told how can I split data.

  0 Comments

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 4 Jun 2019
Rows_of_5 = reshape(YourVariable, 5, []).';

malladi siva kumari
malladi siva kumari on 21 Oct 2019
a=1:1000
a=reshape(a,5,200)

  1 Comment

Walter Roberson
Walter Roberson on 21 Oct 2019
This puts the first 5 as the first column not the first row as required for this purpose

Sign in to comment.

Sign in to answer this question.

Tags

Products


Release

R2018b