MATLAB: How to get the answer “1” by comparing the same value between hex and decimal unit in Simulink

I would like to get an example model to compare between hex and double in Simulink. Please provide an example model to get answer “1” by comparing same value by between hex and decimal unit like as below.

Best Answer

You can use MATLAB Function block to convert hex unit value with hex2dec function like as below.
function y = fcn(u)
%#codegen
y = hex2dec(char(u));
Please find the attached example model to make the goal you want to get the result value "1".