2000x3 decimal matrix to binary matrix conversion with different size for each column

1 次查看(过去 30 天)
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')

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 FPGA, ASIC, and SoC Development 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by