필터 지우기
필터 지우기

matlab csharp programming performance

조회 수: 1 (최근 30일)
Fei
Fei 2013년 4월 19일
I used matlab to call the c# interface to retrieve some data as below:
price = histData.getTickData(...);
price is a list of c# object, which ecapsulates the price info such as price, volume, turnover. I use the below loop to extract the price and convert into matlab matrix
matlab_price = nan(price.Length, 8);
for i=1:price.Length
matlab_price(i,1) = price(1).time;
matlab_price(i,2) = price(1).volume;
...
matlab_price(i,8) = price(1).turnover;
end
The above loop and the 8 assignments were very slow, which took around 0.2s to finish compared to a total of 0.22 execution time. As the price is a c# object, there is no way to use the vector-grammer such as matlab_price(:, 1) = [price.time]; matlab_price(:, 2) = [price.volume]; .. Any idea how to improve the "assigment" performance?
Thanks in advance
  댓글 수: 2
Yair Altman
Yair Altman 2013년 4월 20일
Cross reference: CSSM
Fei
Fei 2013년 5월 7일
Yup. Previously I posted this question to the wrong place.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Licensing on Cloud Platforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by