concatination rows of matrix for making a new matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
zahra hatami
el 2 de Dic. de 2020
Comentada: zahra hatami
el 2 de Dic. de 2020
Hi.i have a matrix(1000 * 64) that is filled with 1 and 0 .i wanna to concatinate bits of rows to make a matrix 1000 * 1 .i dont know how to do it:(
0 comentarios
Respuesta aceptada
Ameer Hamza
el 2 de Dic. de 2020
If you want to pack the bits to create a vector of uint64 datatype then try this
M = randi([0 1], 1000, 64); % random vector
M_new = uint64(M);
x = uint64(2).^uint64(63:-1:0);
M_new = sum(M_new.*x,2,'native');
Ver también
Categorías
Más información sobre Numeric Types en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!