开发者

Matlab or C function [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_如何学Python Closed 11 years ago.

I am doing raytracing. I have not measured any performance numbers. I am thinking of making a separate C function for raytracing and then calling it from my matlab code.

Does it make the program perform better if instead of writing Matlab code?


If it is a well-written MATLAB code (meaning it takes advantage of matrix multiplication wherever possible) than MATLAB usually performs better than C. I remember a professor in college showing us MATLAB could beat even FORTRAN in calculating eigenvectors.

This is speaking typically though; there may be parts of your program that C could perform faster than MATLAB, although typically speaking MATLAB does just as well for well-written code. Here's an example of some very specific benchmarking done at MIT: http://www.ll.mit.edu/HPEC/agendas/proc03/pdfs/nehrbass.pdf

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜