2000x3 decimal matrix to binary matrix conversion with different size for each column
古いコメントを表示
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')
1 件のコメント
Stephen23
2019 年 10 月 16 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!