Fast copy of Matlab array to .NET array

조회 수: 2 (최근 30일)
Sébastien Tosi
Sébastien Tosi 2016년 5월 29일
댓글: Walter Roberson 2016년 5월 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.
Walter Roberson
Walter Roberson 2016년 5월 30일
I do not know about C# arrays.

댓글을 달려면 로그인하십시오.

카테고리

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