2000x3 decimal matrix to binary matrix conversion with different size for each column
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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')
Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!