Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Is it possible to use a ConnectionCallback without an External Script?

1 回表示 (過去 30 日間)
Jeremy
Jeremy 2015 年 1 月 13 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I would like to enable a callback function for a port connection change, in a block within a blockset I am developing for several users. But I do not want to require each of these users to maintain any m-script files in order to use these blocks. I have attempted to use an anonymous function or a function handle within the model's workspace, but I haven't found any syntax which has worked. The functionality I want for this callback would be the same as the block's CopyFcn callback, so the function could be something as simple as:
@(x) eval(get_param(get_param(x,'Parent'),'CopyFcn'))
'x' would be the connection port's handle, its 'Parent' would be the block, and so this line would evaluate the block's copy function. But how do I get the port's ConnectionCallback to execute this line without using an external script?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by