Matlab/Simulink presets

Hi, I am a Matworks user and I would like to know if it is possible to use two different Touch Bar presets, one specific for Simulink and one specific for Matlab that switch automatically depending on the current framework.

Thank you!

I think you could define different set of keys which will be visible with different modifier keys on the keyboard. Just a workaround, but it may get the job done. Otherwise you could try with AppleScript by checking if you are able to extract information if MATLAB or Simulink is active and adjust keys based on it.