How can i reshape a 20370x1 matrix into 2037x10x1?
Show older comments
I have tried to execute this using reshape and permute command.The problem is i am getting either the dimensions as 2037x1x10 or 2037x10. I want the dimension to be 2037x10x1. This is the solution i come up with so far,
>> r=permute(reshape(modu_data_QAM',2037,10),[2;3;1]);
The result= 10 1 2037
modu_data_QAM is a matrix of 20370x1 dimension.
Accepted Answer
More Answers (1)
dpb
on 15 Jul 2015
All arrays in Matlab have implied but not explicit unity dimensions in higher dimensions; you can refer to the array with the third subscript explicitly if need to.
Smaller example of same thing...
>> x=rand(200,1);
>> size(x)
ans =
200 1
>> y=reshape(x,20,10,1);
>> size(y)
ans =
20 10
>> y(20,10)==y(20,10,1)
ans =
1
>>
As you can see, referring to the resulting y array with either two or an explicit third (unity) index results in the same thing.
Why do you think you need the explicit third dimension; show us some code snippets of what you're after that can't seem to accomplish (other than just wishing the implicit dimension would show up with size, say).
1 Comment
shubhi bhadauria
on 15 Jul 2015
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!