Thursday, 4 February 2016

How to Convert 3D Data to 2D Using MATLABIn Feburary 2016 04,

In Feburary 2016 04,
Import your data or create a test array. The following code creates a three-dimensional array of zeros in the form of repeated recordings from eight data channels. Each recording is 100 timepoints long and repeated 10 times.myData = zeros(100,10,8);
Convert the dimensionality of the array using the reshape function. To combine the 10 trials for each channel in the above example, use the following code:myNewData = reshape(myData,100*10,8);This function would return a 1,000-by-eight array with the first two dimensions combined.
Remove singleton dimensions using the squeeze function. Although this is not always necessary, after manipulating your data you may be left with a dimension of length one, called a singleton dimension. The following code would remove singleton dimensions from an array.betterArray = squeeze(arrayWithSingletons);
Analyze your data further as appropriate.
In Feburary 2016 04,

No comments:

Post a Comment