Dynamically sized outputs / work vectors using the Legacy Code Tool
3 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone,
I am trying to build an s - function using the Legacy Code Tool and I have the following problem:
I work with matrices and I want some of the outputs and work vectors to have a dynamically sized first dimension and a second dimension whose size depends on a parameter or input.
So, I want to do this one: (dynamically sized input u1, parameter p1)
def.OutputFcnSpec = 'void step2(double y1[size(u1,1)][size(u1,2)], double u1[][], int32 p1, int32 size(u1,1), int32 size(u1,2), double work1[size(u1,1)][p1], double y2[size(u1,1)][p1])';
But, the compiler does not allow that and I get the following error: "When specifying input/output/parameter/work dynamically sized, all dimensions must be dynamically sized (dwork 1)"
Does anyone have an idea of how I could do that?
Thank you very much in advance.
Agamemnon
0 件のコメント
採用された回答
Kaustubha Govind
2012 年 3 月 2 日
What you're looking to do is output a variable-size signal. Unfortunately, I don't think the Legacy Code Tool can handle generation of S-functions that produce variable-size signals. Perhaps you could generate the S-function for a fixed-signal signal first and then modify it manually to support variable-size signals. See here for an example of an S-function that supports this feature.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で String についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!