我有一個矩陣由1000個二進制元素,如下面在Matlab:我如何用MATLAB中的其他數字替換矩陣的某些元素?
M = 11001100101100001011010001001100101000101110010110001 10000101010110010111 0111001 ...
我怎麼能拆分每3個元素,並取代它們通過另一個元素。例如000到000000,110通過000001,001通過00001,100通過0001,101 001,010通過01,011由1
我用這個方法,但它不工作。它有什麼問題?
Lookup_In = [ 000 110 001 100 101 010 011 ] ;
Lookup_Out = {'000000','000001','00001','0001','101','01','1' } ;
StrOut = repmat({'Unknown'},size(M)) ;
[tf, idx] =ismember(M, Lookup_In) ;
StrOut(tf) = Lookup_Out(idx(tf))
的可能重複[我怎樣才能在編碼MATLAB一些元素?(https://stackoverflow.com/questions/47235922/how-i-can-encode-some-elements-in-matlab) – m3tho