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 Exchange에서 Structures에 대해 자세히 알아보기

제품

릴리스

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