2000x3 decimal matrix to binary matrix conversion with different size for each column
1 view (last 30 days)
Show older comments
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')
Answers (0)
See Also
Categories
Find more on FPGA, ASIC, and SoC Development in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!