% Existing binMap and binaryToText function
binMap = {'0000001', 'A';
'0000010', 'B';
'0000011', 'C';
'0000100', 'D';
'0000101', 'E';
'0000110', 'F';
'0000111', 'G';
'0001000', 'H';
'0001001', 'I';
'0001010', 'J';
'0001011', 'K';
'0001100', 'L';
'0001101', 'M';
'0001110', 'N';
'0001111', 'O';
'0010000', 'P';
'0010001', 'Q';
'0010010', 'R';
'0010011', 'S';
'0010110', 'T';
'0010111', 'U';
'0011000', 'V';
'0011001', 'X';
'0011010', 'Y';
'0011011', 'Z'};
function translatedText = binaryToText(binarySequence, binMap)
index = find(strcmp(binMap(:,1), binarySequence));
if ~isempty(index)
translatedText = binMap{index, 2};
else
translatedText = ' ';
end
end
% Assume that DAQ_1 is the variable you have in the workspace with the binary sequences
% Loop over the received binary sequences and translate them to text
for i = 1:length(DAQ_1)
binarySequence = DAQ_1{i};
% Translate the binary sequence to text using the binaryToText function and binMap
translatedText = binaryToText(binarySequence, binMap);
% Display binary sequence and translation on the screen
disp(['Received binary sequence: ' binarySequence ', Translation: ' translatedText]);
% Here, you can perform additional actions with the translated data if needed
% ...
end