2000x3 decimal matrix to binary matrix conversion with different size for each column
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I actually got support one of the contributor in this website but another thing I have to solve and it is, I have 2000x3 decimal matrix in a .txt file and I want to make it binary matrix but first and second column must be 8-bit and third column 16-bit, also matrix consists negative numbers. How to solve this?
Also I inserted the .txt file.
My code is:
A = readmatrix('test_input_xyz.txt');
[sz1, sz2] = size(A);
A = reshape(A,[],1);
B = sdec2bin(A,16);
B = reshape(string(B),sz1,sz2);
writematrix(B,'Myfile.txt','Delimiter','tab')
Respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!