MATLAB: Do I receive an error when I use the GET_PARAM command to query the name of a Simulink model in Simulink

/blockerrorforwardget_paramnamesimulinkslash

I have a block in a model with the name '/forwardslash'. When I select the block and run the command:
get_param(gcb, 'Name')
I receive the following error:
??? Error using ==> get_param
Invalid Simulink object name: untitled///forwardslash

Best Answer

This is a bug in Simulink in the way that Simulink handles block names containing the '/' character.
To work around this issue, try using the handle of the block to query the name property as follows:
Select the block and run the following code at the MATLAB command prompt:
h = gcbh
get_param(h, 'Name')