nathaniel
nathaniel

Reputation: 11

Display mask parameter on the mask icon

I have a subsystem block that I would like to reuse significantly, with each instantiation differing only by a numeric parameter input via the block mask. I would like to have the number of the parameter displayed as the icon of each block instantiation.

I have attempted to have it display via the icon drawing commands, but I am unsure as to the parameter value to be an input to the disp(), or fprintf() commands. I've added a couple of pictures to detail my (simple) process so far.

Via the mask overlay, a simple parameter is created.

I attempt to reference the parameter via the icon drawing commands.

Upvotes: 1

Views: 4009

Answers (1)

stewythe1st
stewythe1st

Reputation: 21

You have two options.

  1. You can add a get_param call to your display code disp(get_param(gcb,'inputParam'))
  2. You can force the block to run initialization every time, thus ensuring the variable inputParam is accessible to the block without an explicit get_param call. To do this, go into the mask "Icon & Ports" tab and set "Run initialization" to "on" and then call disp(inputParam) like you already were.

Upvotes: 2

Related Questions