creating struct array for libstruct to callib my c code

Hi,
I have b1 struct that has field "UserInput" and size up to 20 and "UserInput" has 2 fields "aaa", and "bbb". For example you can call b1.UserInput(20).a = double(10);
I tried this code.
struct1 = libstruct('struct1_T');
inputStruct = libstruct('UserInput', repmat( {struct1}, 1, 20));
so how do I create struct array in libstruct ?
I use matlab 2017b

回答 (1 件)

Les Beckham
Les Beckham 2025 年 4 月 24 日
移動済み: Walter Roberson 2025 年 4 月 24 日

0 投票

The libstruct documentation specifically states that it only supports scalar structures.

1 件のコメント

Melih
Melih 2025 年 4 月 25 日
編集済み: Melih 2025 年 4 月 25 日
well isnt that really big flaw? Main reason why people use matlab is code generation to cpp. Nobody use matlab in the product. Its really basic coding to use structs. I lost my respect to matlab coders

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

製品

リリース

R2017b

質問済み:

2025 年 4 月 24 日

編集済み:

2025 年 4 月 25 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by