Hi all
I wrote a simple program which calculates inverse matrix size (100*100).
function y = test_inv(x) %#codegen
% test inverse matrix
y = inv(x);end
I created mex function test_inv_mex and tested running time.
x = randn(100);tic;for n = 1: 100 y = test_inv(x);endtoc;tic;for n = 1: 100 y = test_inv_mex(x);endtoc;
This is my resulte :
Elapsed time is 0.054418 seconds.
Elapsed time is 0.613990 seconds.
My question is :
Why the mex function run much slower than regular one ?
B.R
Zohar
Best Answer