transform an empty matrix '0x0 double' into a matrix '0x1 uint8'
Show older comments
Hello! How can I transform an empty matrix '0x0 double' into a matrix '0x1 uint8' as in the figure?

For example in my case, I have a cell 'test_p'. Rows 3 and 4 (0x0 double) should become like rows 1,2 and 5 (0x1 uint8).
test_p = importdata("test_p.mat");
M_0x1_uint8 = test_p{1, 1};
M_0x0_double = test_p{3, 1};
The uint8 command should do the trick. How can I apply it only to those '0x0 double' arrays ?
Accepted Answer
More Answers (1)
x=zeros(0,0);
y=uint8( reshape(x,0,1) );
whos x y
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!