How to combine data of two differnt levels
3 views (last 30 days)
Show older comments
random data is generating for two signals at two levels and separately encoded it. The dimensions of X and Y are 1*100. i want to combine the signals and want to make dimension for two users is 2*1*100. i dont understand how to do it as the data at two levels is different.
N =100;
x = round(rand(1, N));
Y =round(rand(1, N));
dataEnc1 = step(convEncoder,x);
dataEnc2 = step(convEncoder,y);
2 Comments
Accepted Answer
Walter Roberson
on 12 Apr 2019
result = [reshape(dataEnc1, 1, 1, []); reshape(dataEnc2, 1, 1, [])]
3 Comments
Walter Roberson
on 13 Apr 2019
cat(3, dataEnc1, dataEnc2) %if dataEnc* are row vectors
... probably. But you might need
cat(3, reshape(dataEnc1, 1, []), reshape(dataEnc2, 1, [])) %safest
or
reshape([dataEnc1, dataEnc2], 1, [], 2) %if dataEnc* are column vectors
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays 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!