How to copy input port dimensions to output port dimensions in a Level 2 s-function on initialisation?
2 次查看(过去 30 天)
显示 更早的评论
I have some inputs that inherit sizes
block.InputPort(1).Dimensions = -1;
block.InputPort(1).SamplingMode='Sample';
block.InputPort(2).Dimensions = -1;
block.InputPort(2).SamplingMode='Sample';
block.InputPort(3).Dimensions = 1;
block.InputPort(3).SamplingMode='Sample';
I then have some outputs
block.OutputPort(1).Dimensions = block.InputPort(2).Dimensions
block.OutputPort(1).SamplingMode='Sample';
block.OutputPort(2).Dimensions = block.InputPort(2).Dimensions
block.OutputPort(2).SamplingMode='Sample';
block.OutputPort(3).Dimensions = block.InputPort(2).Dimensions
block.OutputPort(3).SamplingMode='Sample';
block.OutputPort(4).Dimensions = 1;
block.OutputPort(4).SamplingMode='Sample';
The above code doesn't do what I intend i.e. to make output ports 1,2 and 3 the same dimensions as input port 2.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!