Fast copy of Matlab array to .NET array

2 次查看(过去 30 天)
On a modern machine NET.convertArray takes about 1.5 second to convert a 1GB Matlab uint8 1D array... Why is it so slow? Is there a faster way to transfer data from Matlab to a .NET array?
  1 个评论
Sébastien Tosi
Sébastien Tosi 2016-5-29
Actually my aim is to pass read only data to a C# class loaded in Matlab. Hence ideally it would be faster not to duplicate data but create a .NET array pointing to the Matlab array... is this possible?

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2016-5-29
"Hence ideally it would be faster not to duplicate data but create a .NET array pointing to the Matlab array... is this possible?"
No. The array data is in-line with some overhead data about bounds and type.
  2 个评论
Sébastien Tosi
Sébastien Tosi 2016-5-30
Then is there a way to convert/cast a C# array? I noticed that conversion of larger type arrays (e.g. int) of same size in memory is significantly faster. Probably since there are less iterations in the loop and the process is not memory bound.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 .NET Methods in MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by