Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

MATLAB Coder seems to be fancy and can speed up MATLAB code much by converting the code into C/C++ or MEX.. But it seems that it does not support sparse matrix, or the matlab function sparse which is essential to my code. Does anyone have any idea about how to overcome this problem? Many thanks!

share|improve this question
1  
Write your own mex function? –  Praetorian Apr 24 at 20:49
    
Isn't the calculation core of sparse code already written in C? I'm not familiar with Coder, but I suspect it only speeds up your own iterative code. It isn't going to speed up calls to builtin MATLAB code. –  hpaulj Apr 24 at 21:50
    
You could also just generate MEX code for the portions of your MATLAB code which doesn't use sparse to speed those portions up. –  lilbill39 Apr 29 at 15:41

1 Answer 1

The eigen library can be used to handle the Matlab function sparse and it is in c language.

As said by "libill", You could also just generate MEX code for the portions of your MATLAB code which doesn't use sparse to speed those portions up.

And for sparse part use above library.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.