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!