"I want to write the number in a Numeric Field box and to send this number to the UART protocol"
From within your app code, these two lines will get the numeric text value and send it to fwrite(). The two lines can be placed in any callback function that responds to interaction with a GUI component. Assuming the numeric text field is named "EditField1",
value = app.EditField1.Value; % or whatever your handle is
fwrite(obj1, value, 'uint8');