Closed stevevanhooser closed 1 year ago
OK, the problem is that the function expects cell arrays rather than arrays. Presumably, in the general case openminds objects cannot be combined into an array because they are different types, although they can be here.
I made the function ndi.database.fun.openMINDSobj2ndi_document
fix arrays to be cell arrays.
It seems to work now.
This code should now work, but a session_id needs to be passed to openMINDSobj2ndi_document:
person1 = personWithOneAffiliation();
person2 = personWithTwoAffiliations();
session_id = S.id(); % get the session id from the ndi.session objects
personArray = [person1, person2];
s = ndi.database.fun.openMINDSobj2ndi_document(personArray,session_id);
generatedTypes = string(size(s));
for i = 1:numel(s)
generatedTypes(i) = s{i}.document_properties.openminds.openminds_type;
end
Eivind reports that this fails to create person2: