Hi, everybody, I got one problem when using S-function dynamic output. The input dimensions of my S function module is constant, i.e., 4,
4 views (last 30 days)
Show older comments
Hi, everybody, I got one problem when using S-function dynamic output. The input dimensions of my S function module is constant, i.e., 4, But the dimensions of my output is dynamic, it is relative to but not the same as the values of one input. Thus, my question is how I set the number of dimension for output in a dynamic or variable way. And I check the matlab document, What it says is the dimension of output is needed to be the same as the dimension of input if we get to use variable output dimensions.
0 Comments
Answers (2)
Kaustubha Govind
on 10 Aug 2012
You haven't mentioned if you're writing a MATLAB S-function, or a C S-function, but this page in the documentation points to demos for both types of S-functions with variable-sized outputs.
Yiqi Liu
on 12 Aug 2012
1 Comment
Sathish Kumar
on 10 Jun 2014
Yes you can get multi-dimensional output out of a 1D input. Just remember to set the correct output port dimension.( block.OutputPort(portid).Dimensions=dim, where dim=[m,n] for an mxn output.), It your outsize changes based on the logic in your program set the output port dimension to -1.
See Also
Categories
Find more on Configure Block Features for MATLAB S-Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!