How to create many variables from a dataset?
1 次查看(过去 30 天)
显示 更早的评论
I have a dataset having 369148 rows organised in two columns. Every 26 rows of the first column contains a specified scale and the next 26 rows a different scale and so on. Second column contains measurement values at every specified scale. Therefore, total 14198 scales each having 26 measurement values making a grand total of measurement values in the second column is 369148. I want to create 14198 variables for every specified scales each having 26 measurement values. Can someone help me out.
0 个评论
回答(3 个)
Steven Lord
2015-9-24
Reshape the original data set so that each of your "variables" is stored as a column of the data.
Stephen23
2015-9-25
编辑:Stephen23
2019-6-19
Thorsten
2015-9-25
You can reshape your data
data = reshape(data, 26, 14198, 2);
You can even let Matlab figure out the elements along the 2nd dimension
data = reshape(data, 26, [], 2);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!