Passing data from Mask to Block
I have a custom block ‘MyBlock’ in my custom Simulink library. Basically it’s clock and a Matlab function block ‘MyFunction’ afterwarts.
The mask of ‘MyBlock’ has a spinbox parameter ‘nValue’. Basing on ‘nValue’ I compute a matrix ‘myMatrix’, and this is a heavy computation but it can be put in Parameter Callback, since ‘myMatrix’ changes only if ‘nValue’ is changed. The block ‘MyFunction’ can performe the calculation using ‘myMatrix’ fast and easy.
The question is: how can I pass myMatrix to the ‘MyFunction’? It is not a mask parameter, so I can’t get assess to it…I have a custom block ‘MyBlock’ in my custom Simulink library. Basically it’s clock and a Matlab function block ‘MyFunction’ afterwarts.
The mask of ‘MyBlock’ has a spinbox parameter ‘nValue’. Basing on ‘nValue’ I compute a matrix ‘myMatrix’, and this is a heavy computation but it can be put in Parameter Callback, since ‘myMatrix’ changes only if ‘nValue’ is changed. The block ‘MyFunction’ can performe the calculation using ‘myMatrix’ fast and easy.
The question is: how can I pass myMatrix to the ‘MyFunction’? It is not a mask parameter, so I can’t get assess to it… I have a custom block ‘MyBlock’ in my custom Simulink library. Basically it’s clock and a Matlab function block ‘MyFunction’ afterwarts.
The mask of ‘MyBlock’ has a spinbox parameter ‘nValue’. Basing on ‘nValue’ I compute a matrix ‘myMatrix’, and this is a heavy computation but it can be put in Parameter Callback, since ‘myMatrix’ changes only if ‘nValue’ is changed. The block ‘MyFunction’ can performe the calculation using ‘myMatrix’ fast and easy.
The question is: how can I pass myMatrix to the ‘MyFunction’? It is not a mask parameter, so I can’t get assess to it… mask parameters, building blocks, parameter callback MATLAB Answers — New Questions