问题
I have an interpreted MATLAB function in my Simulink model. I want to get the block handle or port-handle of this block from user defined .m
function implemented in it (say it test.m
).
I tried
h = get_param(gcb, 'PortHandles'); % for port handle
b = gcbh ; % for block handle
Both gives port handle/block handle for recently clicked block, which I don't want. I want the port handle/Block handle of the interpreted MATLAB function, which is executing this code via .m
function (test.m
). Is there any way to achieve this?
Any help is appreciated.
来源:https://stackoverflow.com/questions/35425619/how-to-get-block-handle-of-interpreted-matlab-function-from-its-m-function