How to get return of list of mwArray?
2 次查看(过去 30 天)
显示 更早的评论
I have a class Batch which contains 4 members as following (in C++):
class Batch
{
public:
float MaxLen = -1;
float** Word;
float* Delete;
};
I have to call Matlab DLL which will return a list of these Batch, prepared as following:
function [Batches] = GetBatches(...)
for i = 1:N_batch
current_batch = Batch();
current_batch.MaxLen = f(...);
...
Batches{i} = current_batch;
end
end
How do I get the return value (list of batches) in this situation. I am aware that if i need to get a single batch, then I need to have sent an mwArray of Batch class as following:
const char* batchFieldNames[] = {"MaxLen","Word","Delete"};
mwArray TestBatchMW(1, 1, sizeof(batchFieldNames) / sizeof(batchFieldNames[0]), batchFieldNames);
GetTestBatch(1, TestBatchMW, TestMW)
0 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!