function [OUT, OUTc] = abcGetBinary(INPUT) % INPUT = 'hello?'; %% LOAD CONVERSION TABLE sheet = 2; xlRange = 'A1:C32';%'A2:A6001'; filename = '/Users/JonBumstead/Documents/PROJECTS/008expandedDisc/bitConversionTables.xlsx'; [~,txt,~] = xlsread(filename,sheet,xlRange); A = txt(:,3); % letters B = txt(:,2); % corresponding binary %% % 000 - 1 bit (2^1) (2) % 001 - 2 bit (2^2) (4) % 010 - 3 bit (2^3) (8) % 011 - 4 bit (2^4) (16) % 100 - 5 bit (2^5) (32) % 101 - 6 bit (2^6) (64) % 110 - 7 bit (2^7) (128) % 111 - 8 bit (2^8) (256) OUT = '100'; % Data type for p=1:length(INPUT) temp = INPUT(p); idx = find(ismember(A, temp)); OUTc{p} = B{idx}; OUT = [OUT B{idx}]; end OUT = [OUT '00000']; % add end sequence OUT =str2binArray(OUT); % save('/Users/JonBumstead/Documents/PROJECTS/008expandedDisc/binary_hello.mat','OUTA');