Override Unit Delay block outptut
Afficher commentaires plus anciens
Product: Simulink Problem Statement: Complex feedback loops implying usage of Unit Delay Block. At certain simulation frame calculation of required values for test generation is becoming complex. Is there a way to override the Unit Delay block output without changing the model (as I am not allowed to do so) rather by using set_param. I am using cvdata/sim/cvhtml combination for my simulation. I tried extracting all the assocaited aparameter sfor Unit Delay using
get_param(gcb,'ObjectParameters');
but was not able to find a suitable parameter to use owing to lack of help information on each parameters.
Kindly help me out if this approach is possible.
4 commentaires
Fangjun Jiang
le 11 Déc 2011
I don't understand your question.
Shouvik Das
le 12 Déc 2011
Walter Roberson
le 12 Déc 2011
Some people would define using set_param as "changing the model". Whether you change the model by set_param or by clicking on the block and changing its parameters, the model is still changed.
Shouvik Das
le 12 Déc 2011
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 12 Déc 2011
0 votes
http://www.mathworks.com/help/toolbox/simulink/slref/f23-20073.html#discrete_lib_blkparams and scroll to the very near the end of that subsection (it is a big subsection) to find a description of all of the parameters for the Unit Delay block. In particular the Initial Conditions (hold period) of the block is controlled by the X0 parameter.
However, it is not clear that you want to change the delay. You speak of changing the output, so it sounds like at the particular point you want to substitute new outputs for the current outputs, and you want to do it at the particular point so that you get the right timing attached to the values. If this is what you want to do, then there is no way to do that by using set_param on the Unit Delay block. Instead, between the Unit Delay block and the block(s) that use the output, you should interpose a MATLAB Function block that examined the input and timestep and determined the appropriate output. If the output of the Unit Delay block is going to multiple other blocks, then Yes, you would end up having to change the attachment points for multiple blocks.
Catégories
En savoir plus sur Programmatic Model Editing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!