matlab - Insert ASCII in LSB -


does know efficient method in order insert ascii value of characters in 8 least significant bits (lsb) of 16 bit number?

the idea comes in mind convert both numbers binary, replace last 8 characters, 16 bit number, ascii value in 8 bits. far know string operations expensive in computational time.

thanks

here matlab implementation of @user1118321 idea:

%# 16-bit integer number x = uint16(30000);  %# character c = 'a';  %# replace lower 8-bit  y = bitand(x,hex2dec('ff00'),class(x)) + cast(c-0,class(x)) 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -