How to write structs within structs in mex functions?
이전 댓글 표시
Hello,
I am currently writing a standalone C code actually to write a .mat file with the MAT-File API which uses mex functions. I have the following structure:
struct position
{
float x, y, z;
};
struct orientation
{
float x, y, z;
};
struct robot
{
string name;
position pose;
orientation or;
};
Then in the main I just use struct robot data to populate my data. How do I do this so as to have several 1x1 struct in matlab environment?
Thanks.
댓글 수: 1
James Tursa
2016년 5월 4일
Are you simply asking how to convert a "robot" struct into an mxArray? E.g., for writing to a mat file and using in MATLAB? Do you want the x, y, z fieldnames carried along or would you rather have them combined into a single vector?
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!