How to get return of list of mwArray?

1 次查看(过去 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 个)

类别

Help CenterFile Exchange 中查找有关 Deploy to C++ Applications Using mwArray API (C++03) 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by