How to convert a .Net array into something Matlab can understand?
2 次查看(过去 30 天)
显示 更早的评论
I have managed to write some .net code and compile it to a dll, and call it successfully from Matlab.
The resulting object exposes a number of properties which are all array of string/double/DateTime.
If I do the following in Matlab
z = Library1.DbData.getData(startDt, endDt);
a = cell(z.a_text_field);
Then I can see the results in a no problem.
However, if I do
c = cell(z.dates,'ConvertTypes','System.DateTime');
Then I get
Error using cell
Conversion to double from System.DateTime[] is not possible.
And if I do
d = cell(z.doubles,'ConvertTypes','all');
Then I get
Error using cell
Size inputs must be scalar.
I could hack this and make everything return a stirng, but it seems a bit ugly. How can I make doubles and datetimes work?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!