S-Function Documentation
2 次查看(过去 30 天)
显示 更早的评论
Hi,
In general mathworks has wonderful documentation. However, im struggling to find the information i need regarding how to use the level 2 s-function with the matlab syntax. For example, in the full sfun template there is a property of the block class called "OperatingPointCompliance" used in the setup method of the template: " block.OperatingPointCompliance = 'Default';". Where is the documentation on the class that this property is owned by? There is some info here on a related method.
Currently, these 2 pages have helped me with some of properties and methods of the class that is being used:
In the template, the level 2 s-function operates on a thing called "block" which appears to be a "Simulink.MSFcnRunTimeBlock" class with parent class "Simulink.RunTimeBlock"...based on the template, the block object (i.e. the level 2 s function block in simulink) is a "Simulink.MSFcnRunTimeBlock" and thus it inherits the properties and methods of its parent class? Are there any other derivative classes that the block has that i should know about when using the level 2 s-function?
Also, s-function template has a series of methods/functions documented here. Can you confirm or correct the following... the s-function is not dependent on this exact structure? For example, theres a method called "outputs", however if i wanted to combine this method with the "update" method, I could simply update the template as follows? Or create my own methods? Lastly, what is the order in which the registered methods of the script operate, is the RegBlockMethod actually calling the method - EDIT - These are nested functions correct? so there is only one top level function and each of subfunctions are executed in the order they appear in the file?
block.RegBlockMethod('OutputsandUpdatesMethod", @OutputsUpdate);
function OutputsUpdate(block)
block.OutputPort(1).Data = block.Dwork(1).Data + block.InputPort(1).Data;
block.Dwork(1).Data = block.InputPort(1).Data;
%endfunction
Thanks in advance,
Andy
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!