Hi I am learning how to create a custom library in matlab. I have attached the file I have so far.
I used a variant subsystem with a mask to allow a user to choose which subsystem to use I have three questions that is really confusing me
1)
My subsystem has different number of input ports but when I choose a subsystem, I do not see that the top level variant subsystem block removes or adds the input port. It's always the maximum number of input ports. How do I make this happen?
2)
In the variant control, I used mode==1, mode==2, etc to switch between subsystem. In my mask callback space, I then used if statements to set the mode based on the user choice in the mask popup. This seem to be adding variables (mode, AdderOptiopnChosen) in the matlab workspace.
What happens if a user deletes the workspace after setting the mask. Is there a way to have these variables contained in the subsystem workspace somehow?
Also is there a better way for the variant subsystem variant control to have access to the mask data somehow?
3)
It seems every time I open the file variantSubsystemTest.slx and I double click on the variant subsystem block, the mask that appears has the popup option grayed out. I then have to unlock the library and then it lets me choose. How will that work when this will be integrated into the simulink library browser?
Thanks for the help, Amish
Best Answer